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.
Can you explain why this works?
I wish there was a "Bad Practices" button for people who name variables this way.
You already solved the kata and can see the control function yourself (click on
Show Kata Test Cases
up here), can you test it and check if this was really an issue? I couldn't reproduce it.python.
I tested a few times, in some cases this occured, in others not.
Tested Python's control function with the input you proposed, it doesn't return any peak.
Which language?
Some random test give the wrong answer according to my understanding of the description. If the array ends with e.g. ......5 3 4 4, the first 4 should not be considered a peak. Following the argument in the description, as you don't know what comes after the last item in the array, you cannot know wheter it is a peak or not.
I encountered some random tests which did call this a peak.
same issue here. a few (15 or 17) of the hidden tests are rejected. The visible tests are all OK.