Python solution with detailed explanation
Solution\n\nFind Minimum in Rotated Sorted Array https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/\n\nKey insight is that if an array is rotat
**Solution**\n\n**Find Minimum in Rotated Sorted Array** https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/\n\nKey insight is that if an array is rotated, then between the two sub-arrays around the mid point, the lowest element lies in the array which is out of order.  Now there are three possibilities which are shown in the figures below. We observe that lowest element is the first element when all elements are sorted. Otherwise it is in the segment about the mid element which is unsorted.\nhttps://goo.gl/photos/3CJrFiV72te92xC88\nhttps://postimg.org/image/asbbeo2c9/.\n\n**What is a single condition that can discriminate between the three cases? **\n* if nums[mid] > nums[high] then minimum number is in right half, otherwise it is in left half (first two)\n* if minimum number must be in the right half, then we must do low = mid+1. Doing low = mid will result in infinite loop. Case: [2,1]\n```\nclass Solution(object):\n    def findMin(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: int\n        """\n        low,high = 0, len(nums)-1\n        while low < high:\n            mid = low + (high-low)//2\n            if nums[mid] > nums[high]:\n                low = mid + 1 # Note that mid+1 is important.\n            else:\n                high = mid\n        return nums[low]\n```\n\n**What if we used nums[low] < nums[mid] as the discriminating condition?**\n* Note that this only helps distinguish 2 and 3 (from figure) and we need a special condition for case 1 when rotation is zero.\n* Note that we dont do low = mid+1. Case [2,1]\n* The stopping condition is again an array of length 2.\n```\nclass Solution(object):\n    def findMin(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: int\n        """\n        low,high = 0, len(nums)-1\n        if nums[low] <= nums[high]:\n            return nums[low]\n        while low < high:\n            mid = low + (high-low)//2\n            if nums[low] < nums[mid]:\n                low = mid\n            else:\n                high = mid\n        return nums[low+1]\n```\n\n**Another Approach**\nWe apply binary search and out stopping condition is an out of order array of length 2. The smallest element is then nums[high]. Do not forget to test for boundary condition that array is in order already.\n```\nclass Solution(object):\n    def findMin(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: int\n        """\n        low,high = 0, len(nums)-1\n        if nums[low] <= nums[high]:\n            return nums[low]\n        while high-low != 1:\n            mid = low + (high-low)//2\n            if nums[low] < nums[mid]:\n                low = mid\n            else:\n                high = mid\n        return nums[high]\n```
[]