Hello sorry but I have resolve the puzzle but I don’t understand why the skill we can obtain is “list” because I have checked the code of others developers and they have used multidimensional array too and not list. Someone can explain me why it’s better to use list and not multidimensional array ?
There are often different ways to solve a problem and it is nearly impossible to list them all as the skills acquired after solving it. Also, the same data structure may be called differently in different programming languages, e.g. as far as I know there is no “array” in python without imports, and a list is used in many cases. Consider the skill indicate a general skill instead of the best way to solve a puzzle.
Ooh, I missed exactly that point!
Another misreading and misunderstanding of the description of another task in Codingame.
So it is NOT the DIRECT neighbor to the right/bottom, but ANY existing neighbor to the right column/bottom row.
Thanks for clearing that out! The description surely did not.
Hello,
I’m using Javascript, I’m trying to store all the coordinates of nodes in an Array, but at the end of my loops I’ve got the same value for all lines. Does someone could explain me why?
For the 1st case, I expect :
[ [ [ 0 , 0 ] , [ 1 , 0] ] , [ [ 1 , 0 ] , [ -1 , -1 ] ] ]
And I’ve got :
[ [ [ 0, 1 ] , [ -1, -1 ] ] , [ [ 0, 1 ] , [ -1, -1 ] ] ]
Hi Everyone,
Am I the only one having trouble passing the validators? Broken square and Tunnel are no good, while my code succed to all the tests in the IDE?
I’m using python btw.
Thank you all
You may create custom cases to test and debug your code offline. Alternatively if you want to check out the validator itself (which you may want to avoid if you want to fully test your debugging skills), you may find and watch the replay by clicking DETAILS in MY REPORT.
Thank you,
I’ll try to debug myself
I have no idea what is being asked. I honestly think the hardest part of this problem is figuring out what the hell the problem is trying to say. I don’t understand what is even being asked of us. Looking at the example only makes the question/problem more impossible to understand. I really wish questions went through edits by multiple authors to ensure what is being asked makes sense…
Imagine you have a spreadsheet. Some cells are empty and some cells are not. The problem is like finding the next non-blank cell if you move right and the next non-blank cell if you move down.
Thank you for this one, it reeeally helped me
Hi!
Need some help understanding the second test case.
I have the following data:
Standard Error Stream:
Width: 5
Height: 1
Line: 0.0.0
Result: 0 0 -1 -1 -1 -1
Result: 2 0 -1 -1 -1 -1
Result: 4 0 -1 -1 -1 -1
Game information:
(-1, -1) is not to the right of (0, 0). Expected (2, 0).
How can 2,0 be next to 0,0?
Is the actual input supposed to be
0.0.0
or
000
…
Because in my mind there is no valid nodes next to 0,0
The requirement is to find the nearest nodes to the right and to the bottom, and they are not necessarily immediately adjacent.
Is there any solid reason why indexes of rows and columns are inverted?
I mean, usually, (1,0) means row 1, column 0…
Because the (x, y) coordinate format is used in the puzzle instead of the (row, column) format.
Yeah, I see it, but the system of coordinates is rotated of -90° (from top to bottom but with positive coordinates values).
It’s a beginner challenge, wouldn’t it make more sense to make it like math background implies?
I’ve seen people transposing the matrix to solve it, just saying…
Oh, I get what you mean. There are some puzzles on this website which follow the coordinate system you have described, but I think many follow the “inverted” system because that is less clumsy when reading inputs and counting the rows. For example, in Python, one may use:
for row_num, value in enumerate(input().split()):
In the “normal” system (where x coordinates/row numbers increase upwards), row numbers cannot be obtained so conveniently. But then, the situation may not be that different in other programming languages.
Using Java.
The error messages for failed tests are not always consistent with what is shown in the sample.
i.e. I received error messages such as “Expected… but output was ‘’” (error/debugging shows an output), entering a String saw errors about “int expected.”
The answer needs to be in x1 + " " + y1 + " " + x2…
Other than that, fairly straightforward.
For my solution, I moved the input into a 2d array, then looped through the array and checked each value.
One of the “fail” mentions is “you compute the same node twice.” This only applies to the origin of the first selected node - the neighbors do not count as being ‘computed’ as part of this.
i.e. the example should have 3 lines - one each for the nodes at [0,0], [0,1], and [1,0].
The example test has the values:
00
0•
is this right? there is one empty line between 2,0 and 2,2 and the test is expecting 2,2 to be below 2,0
Standard Error Stream:
…0…
…
…0.0.0
…
0.0.0…
…
…0…
Standard Output Stream:
2 0 -1 -1 -1 -1
Game information:
(-1, -1) is not below (2, 0). Expected (2, 2).
Because the requirement is just to find the nearest node, which may or may not be immediately adjacent to the original node.
hi
could you help me understand the rules
looks like there is a mistake
according your rules and task 01 the last output for the last node is
0 1 -1 -1 -1 -1
pay attention for the x3y3. this node is not in space of the matrix.
I mean matrix was 2*2 [0,0 1,0 0,1 1,1] and the x3y3 from the last line is linked to 0,2. and this answer is correct
but when I try execute task 2, where matrix is [00 10 20 30 40]
and make output
0 0 -1 -1 -1 -1
because there are no next node to the right and next node to the down
but this answer is incorrect
so for task 1 when we print xy not from matrix its ok
but for task 2 is not ok