Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.

Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).

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

the complexity of this solution i O(N), fe if the input is [1,1,1,.....,1,1] (all the sam for let say 1bn times) You need 1bn iterations of main loop.

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.