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.
Thanks a lot!
you saved my day
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
It's even written in bold, please read the description before raising issues ...
I think there's a problem with random tests. Some of them have wrong output.
For example this one:
A test says that we cannot catch mouse within 9 moves. But it's not true. If we move horizontally we are able to catch mouse in 5 moves.
Here's how to do that:
For each move we take 9 steps and have to make 5 moves in total to reach the mouse.
.repeat
also depends onn
so time complexity is O(nlogn)I wouldn't recommend using bitwise operators in production code they are really hard to understand and debug. I had hard time debugging production code that utilized bitwise operators.
There's a way to make it one line tho :)
One line solutions are usually not the best ones (in terms of performance and readability) but people still upvote them because they look cool
This comment is hidden because it contains spoiler information about the solution
Finally a O(n) solution!
Isn't it the whole point of these coding tasks — to find a performant solution (in terms of big O)?
This comment is hidden because it contains spoiler information about the solution
/
This comment is hidden because it contains spoiler information about the solution
Loading more items...