three line solution-- beat 91%.


  • 0
    S
    def findMin(self, nums):        
            #if nums[0] < nums[-1]: return nums[0]
            for i in nums:
                if i < nums[0]: return i
            return nums[0]
    

Log in to reply
 

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