[Python] Binary Search with Picture - Clean & Concise
Idea
This is a simple version of this problem 33. Search in Rotated Sorted Array.
Firstly, we check edge cases (when index of the minimum number is 0):

If len(
**Idea**
- This is a simple version of this problem [33. Search in Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/).
- Firstly, we check edge cases (when index of the minimum number is 0):
	- If len(nums) == 1 return nums[0]
	- If nums[0] < nums[n-1] return nums[0]
- Binary search, left = 0, right = n-1
	- mid = (left + right) / 2
	- If nums[mid-1] > nums[mid] then nums[mid] is the minimum
	- If nums[mid] > nums[right] then search on the right side, because smaller elements are in the right side
	- Else search on the left side.

![image](https://assets.leetcode.com/users/images/be120c8c-0619-4bbb-86bc-4327d2443d22_1630412938.9456122.png)


```python
class Solution:
    def findMin(self, nums: List[int]) -> int:
        if nums[0] <= nums[-1]: # Already sorted
            return nums[0]

        left = 1
        right = len(nums) - 1
        while left <= right:
            mid = (left + right) // 2
            if nums[mid-1] > nums[mid]:
                return nums[mid]

            if nums[mid] > nums[right]:
                left = mid + 1
            else:
                right = mid - 1
```
Complexity:
- Time: `O(logN)`
- Space: `O(1)`
['Binary Search']