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.
Great kata to learn dynamic programming and to exercise with.
I was being Pythonic when I wrote this. I would agree that x!=0 is more readable. https://docs.python-guide.org/writing/style/
It could equally have been used and would have been more readable IMO. As to why it was not? Perhaps the author preferred a shorter solution, or perhaps they find it just as readable, perhaps perhaps perhaps...
This comment is hidden because it contains spoiler information about the solution
It is part of the loop, and it filters all
x
that are not a falsy value (0, False, empty string, etc). Look up list comprehension for more details.can someone tell me what is the role played here by "if x" after for loop in the program
hmm smart:))
This comment is hidden because it contains spoiler information about the solution
What a great kata, from the beginning i was between 43 - 47(for a long time), then 51 for a while, at last...........Alhamdulillah!!
Thanks seased!!
Ohhh, I totally misunderstood the assignment lol. I thought the first instruction would be executed until it hits a hole, then the next, and so on.
Thank you!
if DR is executed endlessly (i.e. DRDRDR...) it will fall into the hole at (5,5)
if DRD is executed endlessly, it will leave the area on the down side.
Hi all,
How is it that
DR
is not a solution for the example test case#3
? Which is as follows:It'd start from (0, 0) and move down until it hits the H (hole) at (2, 0). So from (1, 0) it moves right till the end of the matrix because there are no holes in that row.
For
DR
it says: "Your robot fell into a hole at x: 5 y: 5".I also don't get why would
DRD
be a valid solution.Is there someting I'm not getting from the assingment?
Thanks!
Much better than the top one. Cleanest and most intuitive so far.
Still linear though.
Thanks for the hint!
I removed the ambigous test case.
Loading more items...