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.
duplicate of this suggestion
After so many years, it seems like the definition of a 'peak' is still missing
The instructions imply the opposite.
From the description:
Also, beware of plateaus !!! [1, 2, 2, 2, 1] has a peak while [1, 2, 2, 2, 3] and [1, 2, 2, 2, 2] do not.The instructions are wrong, they imply that 1 2 2 2 2 is a plateau peak, but in the test it's not (the position of the plateau matches the edge so it's invalid).
agree
This comment is hidden because it contains spoiler information about the solution
c#, how does the dictionary make any sense here
what a poorly written description
Hi Blind4Basics,
Your right about that because for the plateau the immediate neighbours on the left and right have to be equal.
Hi,
Closing.
Thank you for the time and effort the team invested in preparing this question. I have a few suggestions that may help us better understand the problem.
In the example provided — arr = [0, 1, 2, 5, 1, 0] — the peak is at position 3 with a value of 5 (since arr[3] = 5). It would be helpful to explicitly explain what qualifies a value as a “peak.” In this case, 5 is a peak because it is greater than both of its immediate neighbours on the left and right.
Please let me know your thoughts on this suggestion.
This question is so good. Even though it’s simple and intuitive, you still take time to figure out the plateau logic. I’ve solved a lot of questions, but this one still caught me off guard.
I can see you have a successful submission so you must've figured it out.
I see that you have figured out your issue as you have a succesful solution now.
The author doesn't want a string. They want a mapping (hashmap, hash, dictionary) with keys named
posandpeaks, and both keys should refer to values that are arrays (lists, sequences) of integers.Loading more items...