# Find Minimum in Rotated Sorted Array

Suppose a sorted array is rotated at some pivot unknown to you beforehand (i.e., `[0, 1, 2, 4, 5, 6, 7]`

becomes `[4, 5, 6, 7, 0, 1, 2]`

). Find the minimum element.

Example

```
Input Return
[1, 2, 3, 4] 1
[2, 3, 0, 1] 0
```

The following algorithm uses binary search, which has the time complexity of O(log n), where n is the number of elements.