Ad
  • Custom User Avatar

    Make sure you're not mutating the input array and also, there are more than 3 peaks there, so your answer is wrong.

  • Custom User Avatar

    Random Test in C#

    Testing for 7, 2, 12, 11, 16, 3, 14, 10, -2, 2, 14, 14, -4, -2, 13, 1, -2:
    Values differ at index [3]
    Expected: 10
    But was: 14

    Here's my printed lists:
    pos: 2, 4, 6
    peaks: 12, 16, 14

    How is 10 a peak, but 14 isn't?

  • Custom User Avatar

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