The problem is incorrectly stated


  • 0
    S

    The problem says that "A peak element is an element that is greater than its neighbors." but for there to be a logN solution the statement needs to be "A peak element is an element that is greater than or equal to its neighbors.".

    In particular, given what the problem says today, there may be sequences without a peak element. (e.g. [1,1]).


Log in to reply
 

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