c++ solution || binary search (log n)
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\nO(log n)\n\n- Space complexity:\nO(1)\n![IMG_9181.jpg](https://assets.leetcode.com/users/images/11ba6d96-e074-4947-b06a-308c2a1e6c2e_1682703362.935578.jpeg)\n\n\n# Code\n```\nclass Solution {\npublic:\n    int findMin(vector<int>& nums) {\n        int i=0;\n        int j=nums.size()-1;\n        while(i<j){\n            int mid = (i+j)/2;\n            if(nums[mid] > nums[j]) i = mid+1;\n            else j=mid;\n        }\n        return nums[i];\n    }\n};\n```
['Binary Search', 'C++']