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.
I was so close to this before I just decided to use a loop, genuinely agonizing.
Actually, your solution is DRY in the runtime sense but the solution above is actually more DRY in terms of code since you don't have to repeat certain things.
This comment is hidden because it contains spoiler information about the solution
lol
which is why this is predominantly voted a clever solution
You run N times
d === 'R'
you can DRYah ha Thanks !
I meant, arrow function doesn't need return. Read this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions
but this solution didn't use 'return'
No.
does arrow function no need 'return'?
Yes! Copy the array first (e.g.,
Array.prototype.slice
or[...array]
), then you can mutate it as much as you want.np. ;)
You may find some bits of information here: https://github.com/codewars/codewars.com/wiki
Sorry, I am still learning how to use the site properly. Will need to look into guidelines more.
this is mutating the input. Bad practice...
Loading more items...