Python - O(logn) - Detailed Explanation
Idea:\n\nWe have an array that have been sorted at some index unknown to us, let\'s call this index the inflection point (IP).\nSide note: You can solve all the
#### Idea:\n\nWe have an array that have been sorted at some index unknown to us, let\'s call this index the `inflection point (IP)`.\n**Side note: You can solve all the rotated array questions using inflection point technique... good for interviews, I\'ve been asked this question in an onsite interview**\n\nWe can identify the IP as: **The only place where arr[IP] > arr[IP + 1] and arr[IP] > arr[IP - 1]**. Basically the only element which is bigger than both left and right elements.\nLet\'s take the following array as an example:\n`[4, 5, 0, 1, 2, 3]`.\n\nBased on the characteristics above, we can conclude that `5` is the IP.\nIn addition, we can see that elements from index `0...IP [0, IP]` and `[IP + 1, n ]` are always increasing, from this we can infer that is it enough for us to compare `min(arr[0], arr[IP + 1])` for our answer.\n\n**Edge case**: no inflection point, IP will be the last index. So if IP == n - 1 just return arr[0]\n\n#### Algorithm:\n\n```\nclass Solution:\n    def get_inflection_point(self, A):\n        n = len(A)\n        left, right = 0, n - 1\n        \n        while left <= right:\n            mid = left + (right - left) // 2\n            if mid == n - 1  or A[mid] > A[mid + 1]:\n                return mid\n            \n            # inflection point to right\n            if A[mid] >= A[left]:\n                left = mid + 1\n            else:\n                right = mid - 1\n                \n        return left\n        \n    def findMin(self, A: List[int]) -> int:\n        n = len(A)\n        IP = self.get_inflection_point(A)\n        if IP == n - 1:\n            return A[0]\n        \n        return min(A[0], A[IP + 1])\n        \n```
['Binary Tree', 'Python']