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 description says that you can:
"
rollback
User should be able to rollback a set amount of turns on the go board.
"
Accordingly, the rollback method takes one argument - the number of steps back. Which means to return the state of the board n moves back. This means that every movement on the board must preserve the previous state of the board in order to return to it if necessary.
For example, after movements for board 9x9, the result will be a board:
If the rollback method with argument 2 is called, the result will be a starting board:
I hope this clears something up?
p.s. Initially did not specify, I will add, that together with the rollback of the board, rollback should also be made for the order of the players' moves.
Did you implement fib for negative inputs?I had also implemented O(log n) but I had forgotten to consider negative inputs and that made the function recur infinitely.
This should be reported as a kata issue.
Kata creation is the users' ability, not a CW's function or CW developers' responsibility.
Katas with performance requirements often have tags like
performance
,optimization
,math
, and/or performance-specific notes in the description about the input size or approximate time complexity that is expected. If some kata has performance requirements but doesn't provide any information about it, you should ask the author to do so.If solution times out, it's too inefficient - as simple as that. Figuring out your code's time complexity is your job, and if for some reason you want to know how many tests you're passing, you can always do something like this:
Exactly, some expected outcomes would be good!