Ad
  • Custom User Avatar

    duplicate of this suggestion

  • Custom User Avatar

    After so many years, it seems like the definition of a 'peak' is still missing

  • Custom User Avatar

    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.

  • Custom User Avatar

    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).

  • Custom User Avatar

    agree

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    c#, how does the dictionary make any sense here

  • Custom User Avatar

    what a poorly written description

  • Custom User Avatar

    Hi Blind4Basics,

    Your right about that because for the plateau the immediate neighbours on the left and right have to be equal.

  • Custom User Avatar

    Hi,

    • Your explanation doesn't fit with the plateau case
    • what a peak is is already explained at the very first line : local maximum.

    Closing.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    I can see you have a successful submission so you must've figured it out.

  • Custom User Avatar

    I see that you have figured out your issue as you have a succesful solution now.

  • Custom User Avatar

    The author doesn't want a string. They want a mapping (hashmap, hash, dictionary) with keys named pos and peaks, and both keys should refer to values that are arrays (lists, sequences) of integers.

  • Loading more items...