# Find Minimum in Rotated Sorted Array

```python
class Solution(object):
    def findMin(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        left, right = 0, len(nums)-1
        # <= 會無窮迴圈, 因為 right = mid 沒有減 1
        while left < right:
           
            mid = (left + right) // 2                                      
            if nums[mid] > nums[right]:               
                #[3,4,5,6,7,8,9,1,2] 
                left = mid + 1
            else:                          
                # [8,9,1,2,3,4,5,6,7]
                right = mid
        return nums[left]
```
