Python Solution - in 2 lines


  • 0

    without using binary search

        def findPeakElement(self, nums):
            """
            :type nums: List[int]
            :rtype: int
            """
    
            d = { n:i  for i, n in enumerate(nums) }
            return d[ max(d.keys()) ]
    
    

Log in to reply
 

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