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.
The best! How it worksw? :-D
seriously it is works ;)
Hi!
So, what if we have array {1,1,-1}? It will loop but will not get back into "0" position. Would be a nice test case :)
Let us hope the efficiency will become OK with some future optimizing Java compiler.
A very enlightening kata. Thank you sensei!
Enjoyed the puzzle! Thanks!
Thanks!
Liked this kata: it has no "swift and clever" solution, had to work hard and elaborate all cases.
O(2^n) as it seems to me, in a really-really worst case:
when at each step you have to explore both trees to full depth (or near full).
A very clever and concise solution, though maybe Java strings will add unneeded worktime too:
substring() is O(length copied), not O(1).
This comment is hidden because it contains spoiler information about the solution