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.
This comment is hidden because it contains spoiler information about the solution
Of course, but you need to remeber that this task is designed for starters.
In productive code, I prefer
i - n
instead of usingi + (n * -1)
to avoid unnecessary computations. That was a long time ago but I think, I wanted to show how I came up to this solution.Maybe it's not the same formula:
i + (n * -1) = i - n
You need n in your formula, otherwise you don't know how far you should rotate.
i - 1 won't work for n > 1 in my solution.