Special judge: No expected output available.


  • 0
    H

    Input: [2,1,2]
    Output: -1
    Expected: Special judge: No expected output available.

    What we suppose to do when there's no peak? Assume I use java


  • 3
    S

    Since the problem description explicitly says "num[-1] = num[n] = -∞", there is always at least one peak in any given sequence. In the case of [2, 1, 2], the peak index is either 0 or 2.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.