Simple Python solution


  • 0
    X
    class Solution(object):
        def findMin(self, nums):
            """
            :type nums: List[int]
            :rtype: int
            """
            if len(nums) == 1:
                return nums[0]
            if sorted(nums) == nums:
                return nums[0]
            return nums[len(nums)-sorted(nums).index(nums[0])]
    

Log in to reply
 

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