Ad
  • Custom User Avatar

    Basically there is an element after it (there can be elements equal than after it too, those are part of the plateau) that's less than it, and there was another less than it before.

  • Custom User Avatar

    You have to somehow store a peak candidate until you can say for sure if it was a peak or a peak-plateau or disregard it if it wasn't.

  • Custom User Avatar

    There's no peak there.

    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.