Easy to Understand ||O(log(n)) time O(1) space
Intuition\nWe want to search for the minimum of the array.And it\'s pretty obvious the minimum of the array would lie as the first element of the non rotated or
# Intuition\nWe want to search for the minimum of the array.And it\'s pretty obvious the minimum of the array would lie as the first element of the non rotated or non shifted part of the array.So we try to reach to the non shifted part of the array.\n\nEx:- Consider the array (4,5,1,2,3)\nHere (4,5) represents the rotated part of array and (1,2,3) represents the non rotated part of the array.\n\n# Approach\n1)Keep two pointers low and high.Whenever mid element is higher than low element it means that we are still in the rotated part of the array.So we Shift your low 1 place ahead of the mid element.\n\n2)Else if that is not the case,it means we are already in the non rotated part of the array but in the farther right side,so we shift the high 1 place behind the mid.We do this to reach that part of the non rotated array which has lesser value elements.\n\n3)Each time during the search we take a mini variable which stores the minimum between mid element,low element and mini in mini.\n\n# Complexity\n- Time complexity:\nO(log(n))\n\n- Space complexity:\nO(1)\n\n# Code\n```\nclass Solution {\npublic:\n    int findMin(vector<int>& arr) {\n        int n=arr.size();\n        int l=0;\n        int h=n-1;\n        int mini=INT_MAX;\n        while(l<=h){\n            int mid=l+(h-l)/2;\n            mini=min(mini,arr[mid]);\n            mini=min(mini,arr[l]);\n            if(arr[mid]>=arr[l]){\n                l=mid+1;\n            }\n            else{\n                h=mid-1;\n            }\n        }\n        return mini;\n    }\n};\n```
['Binary Search', 'C++']