Expected: Special judge: No expected output available.
What we suppose to do when there's no peak? Assume I use java
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.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.