There's no special math you need to learn. You have a system of equations (sum and product) that you can manipulate to reduce the Big(O) of your algorithm. Not sure if that helps (without giving the answer away).
First test creates 2 blocks and asks for values of 1st one. Your error message Expected: 3, instead got: 1 indicates the 2d block you created crashed data of 1st one. (3 is value of 1st Block width, 1 is value of 2d Block width)
So it seems the problem is with your code.
Good luck!
I'm having my code pass the test cases just fine but am getting caught up in the main submission with an (Expected: 3, instead got: 1) error. I tried changing around the 'data array' position that the various measures (width et c) were reading and got the first submission test to clear but then the second test was failing.
Is this a problem with my code or in the submission tests?
This comment is hidden because it contains spoiler information about the solution
There's no special math you need to learn. You have a system of equations (sum and product) that you can manipulate to reduce the Big(O) of your algorithm. Not sure if that helps (without giving the answer away).
This comment is hidden because it contains spoiler information about the solution
This is a useless reply. I've downvoted it.
The math and algebra behind the solution (at least the most popular and efficient solutions) are not so complicated.
This comment is hidden because it contains spoiler information about the solution
Thanks for the reply. I've since worked out the issue, it turned out one of my for loops was running too long or something.
Good to note about the markdown though! Thanks for mentioning that!
On the side note always format your code using Markdown. An extract from Markdown link -
Try using
row = row.concat("\\n");
Instead ofrow = row.concat("\n");
. Then check your output with the text fixture code manually.This comment is hidden because it contains spoiler information about the solution
Great, this should help me. Thanks.
First test creates 2 blocks and asks for values of 1st one. Your error message
Expected: 3, instead got: 1
indicates the 2d block you created crashed data of 1st one. (3
is value of 1st Block width,1
is value of 2d Block width)So it seems the problem is with your code.
Good luck!
javascript
which language ?
I'm having my code pass the test cases just fine but am getting caught up in the main submission with an (Expected: 3, instead got: 1) error. I tried changing around the 'data array' position that the various measures (width et c) were reading and got the first submission test to clear but then the second test was failing.
Is this a problem with my code or in the submission tests?