Python Solution beating 99.86%


  • 0
    L

    first, last = 0, len(nums)-1
    while first <= last:
    mid = (first + last) / 2
    if nums[first] > nums[mid]:
    last = mid
    else:
    if nums[first] > nums[last]:
    first = mid + 1
    else:
    last = mid - 1
    return nums[first]


Log in to reply
 

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