### Solution

In a rotate array, there will be a position where the `sequence changes`

, no longer ascending and that number will be the minimum we are searching for. Accordingly, we can adopt binary searching to find it out and the key will be that `sequence change`

. Let's suppose `l`

and `r`

will be the start and the end of the array and `m`

is the middle between them.

- First, if
`nums[m] > nums[r]`

then the`sequence change`

number will be between m and r. - Second, if
`nums[m] < nums[r]`

, then the`sequence change`

number will be between l and m. - Third, if there exist duplicates and result in
`nums[m]==nums[r]`

then we will not know that that`sequence change`

number but one thing for sure,`nums[r]`

will not be the minimum so we can just move the`r`

backward to eliminate`nums[r]`

by`r--`

, which can then be able to terminate the searching properly.

The third part is the essential, which delicately handle the duplicates and terminate the searching elegantly.

```
class Solution {
public:
int findMin(vector<int>& nums) {
int l = 0, r = nums.size()-1;
while(l < r){
int m = l+((r-l)>>1);
if(nums[m] < nums[r]) r = m;
else if(nums[m] > nums[r]) l = m+1;
else r--;
}
return nums[l];
}
};
```

Always welcome new ideas and `practical`

tricks, just leave them in the comments!