[C++] Binary Search | 100% FASTER
Please upvote if it helped you.\n\t\n\tclass Solution {\n\tpublic:\n\t\tint findMin(vector& nums) {\n\n\t\t\tint first = 0; \n\t\t\tint last = nums.size() - 1; 
Please upvote if it helped you.\n\t\n\tclass Solution {\n\tpublic:\n\t\tint findMin(vector<int>& nums) {\n\n\t\t\tint first = 0; \n\t\t\tint last = nums.size() - 1; \n\t\t\tint ans = INT_MAX; \n\n\t\t\twhile(first <= last){\n\n\t\t\t\tint mid = first + (last - first) / 2; \n\n\t\t\t\tif(ans >= nums[mid])  ans = nums[mid]; \n\n\t\t\t\tif(nums[mid] > nums[last]) first = mid + 1; \n\n\t\t\t\telse last = mid - 1; \n\t\t\t}\n\n\t\t\treturn ans; \n\t\t}\n\t};\nThank You !!
[]