✅Beats 100% || Easy || Binary Search || C++
\n\n# Code\n\nclass Solution {\npublic:\n    int findMin(vector<int>& nums) {\n        //using log n algo(binary search)\n\n        int low=0;\n        int high
\n\n# Code\n```\nclass Solution {\npublic:\n    int findMin(vector<int>& nums) {\n        //using log n algo(binary search)\n\n        int low=0;\n        int high=nums.size()-1;\n        int ans=INT_MAX;\n        while(low<=high){\n            int mid=low+(high-low)/2;\n            if(nums[mid]>=nums[low]){// means left half is sorted\n                ans=min(ans,nums[low]);  //storing the minimum \n                low=mid+1; //eleminating left half\n            }\n            else{ //else right half is sorted\n                ans=min(ans,nums[mid]);// storing the minimum\n                high=mid-1;\n            }\n        }\n        return ans;\n    }\n};\n```
['C++']