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.
...looks pretty though
Went into comments just to say that, thanks dude for doing the work for me.
that's normal initialisation of variables, the data type doesn't matter
makes the code more compact
modulo operation correct?
If what you mean is how it works, in here it prevents Index out of range by taking the leftover of a division.
So by having the length of the original list when the number goes higher it instead loops arround to 0 every multiple of it.
Sorry for being dumb. can someone please explain how is the modulo operation correct?
Thanks
is it best practice to assign variables like this, when i and ys are different data types? I guess I can get used to it but it was confusing to look at at first.
i found solution, tks bro!
Print the input (hoping you are not modifying it) and the expected solution to debug.
it's strictly kata, i passed 45 and 5 fails, i dont know where wrong
okay thank you
It is not, read my answer there. And when posting code like that, it should be marked as having spoiler content (I wasn't the one who marked it, but I'd do it if you didn't).
oops
I guess
unshift
has to move all the elements one position and then you have a nested loop there. Not sure, but very likely.This comment is hidden because it contains spoiler information about the solution