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.
You are mutating the original array passed as an argument to the function. This is not allowed in real code.
This comment is hidden because it contains spoiler information about the solution
can you please explain in which line it would break?
How does this not break your function if it inputs a prime number.
@NoneAli it's actually just O(n^2); when calculating time complexity, constants are ignored
2n^2
Clever idea but doesn't work. "nnwnnwnsns" is deemed a valid walk but would leave you 6 blocks away. Change E to 200 and W to -200.
Don't know why people vote for this being clever..
If you write functions like this, it will break the moment a 3rd parameter is passed in the input..
And I thought mine was clever..
You may revise both the problem and the solution if you wish, then convince me of your point of view. However, if you choose not to do so, that's perfectly fine. I provided those comments mainly for anyone who might find your previous explanation, ehh... a bit strange or with flawed logic. And I did it only for educational reasons.
Dear @Outstandinggirl13 I think the time gap between when I solved it and the following comment is over 6 months, thus your comment now puts me in 14 month gap from the solution I thought of. So you cannot expect me to remember the solution. From what I can remember, I got lucky with the test cases and tested with the numbers at the end to be honest.
whats the time complexity for this?
This comment is hidden because it contains spoiler information about the solution
Watched your video !!
Thanks again for updated video! <3
Loading more items...