[1] is expected to return 0 ?


  • 0
    A

    in the problem statement it is assumed that num[-1] == num[n] == - infinity

    therefore I would expect [1] to return 1 not 0 !

    Advise ?

    -A


  • 0
    J

    The function should return the index of the peak value, not the peak value itself. The first element of the array (the only element in an array with exactly one value) will have an index of 0.


Log in to reply
 

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