[1] is expected to return 0 ?

  • 0

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

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

    Advise ?


  • 0

    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.