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.
Sorry for the late reply, your code is wrong, it's giving false positives on things that aren't plateaus. Print the input and you'll see it.
Read this: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution#print-input and don't mutate the input.
It happened to me too. Also, in my case, with java, every time I try to attempt the random tests fail, but if I put those on the testing section then the tests pass.
Array(n)
creates an array of lengthn
,[...Array(n)]
creates an array filled withundefined
, of lengthn
.