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.
That's one clever use of
switch
:Dcool!
hey this is wak
You can print the input and analyze it yourself. And IIRC the description is clear about the specifications.
I was also stumped, but re-read instructions and it's probably related to:
Also, beware of plateaus !!! [1, 2, 2, 2, 1] has a peak while [1, 2, 2, 2, 3] does not.
So imagine you are working with an arr like [1, 2, 2, 2, 3, 3], where the second to last number (the first 3) is giving you a false positive.
Edit: and also imagine if you are working with double plateaus such as [1, 2, 2, 3, 3, 1]. In this case, the peak should be the first 3, but it's possible that the first 2 is giving you a false positive resulting in 2 peaks, when there should only be 1 in this case.
Hopefully final edit: I created a test scenario which your code might not pass according to your errors: [1,1,2,2,3,5,5,5,3,3,3,1,2,3]. There should only be 1 peak, but your code might give 2. Just passed this, so hopefully this helps.
I'm kinda struggling to find out what I'm doing wrong here. My code works perfectly with tested inputs but fails 2 of the Kata's tests.
Nice piece!
Thanks SteffenVogel_79 Got it! :)
Yes. First take every 2nd char. And then the "other chars" are the chars, that are not every 2nd char. :-)
Thanks to both of you! :-)
I couldn't agree more! :)
I have written the code already, but keeps failing at the last EncryptionExample tests. When you say other chars, are you referring to the unselected ones?
Take every 2nd char from the string. Then the other chars. Do this n times! Whats wrong!?
Thanks for the great kata!!! It causes the brain to work.
Hi guys! I don't really get what I should be doing with this kata. Can someone point me in the right direction? The desription is not adequate. Your help is highly appreciated. :)