Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I'm sure that u are creating a new node with Node(pos), a node with default values like passable = True, to access to a node in the grid just pos.position or pos.passable.
well i know im the dumb here, but this katas description is just way off.
Node
classthe node.position returns no valuable information, at least for dumb me.
the node.passable returns true for every position.. great invention..
def find_shortest_path(grid, start_node, end_node):
S0110
01000
01010
00010
0001E
(0,0) True
(0,1) True
(0,2) True
(0,3) True
(0,4) True
(1,0) True
(1,1) True
(1,2) True
(1,3) True
(1,4) True
(2,0) True
(2,1) True
(2,2) True
(2,3) True
(2,4) True
(3,0) True
(3,1) True
(3,2) True
(3,3) True
(3,4) True
(4,0) True
(4,1) True
(4,2) True
(4,3) True
(4,4) True
how im supposed to know which node is truelly passable?
I confirm. Even accepted solutions are too slow.
It seems most solutions pass in about 500 ms, a recursive solution passes in about 2 s.
python is too slow for it or idk.. two legit solution is getting time outs. Even copy pasted one solution from github, same problem shows up. I think there are just too many tests to run under the given 12 sec. a bit disapointing.
yeah mine too! but is there any benefit of these huge one liners?
Try looking into the difference between '==' and '===' operators
https://developer.mozilla.org/en-us/docs/Web/JavaScript/Reference/Operators/Strict_equality
False is 0, but 0 is not False, so first tell what should be done when False than with 0. Interesting that the bool will be 0 even if its converted to string.
if i is False:
action
if i is 0:
action
this! now makes sense, thanks.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
number = random number, can be any, the system will provide them.