✅Accepted beats 100% || Java / C || Solution
Complexity\n- Time complexity: O(log n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity:\n Add your space complexity here, e.g. O(n) \n\n# JAV
# Complexity\n- Time complexity: **O(log n)**\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# JAVA :-\n -- | Details | --\n--- | --- | ---:\n**Runtime** | 1ms | Beats **100%**\n**Memory** | 40MB | Beats **20%**\n```\nclass Solution {\n        public int findMin(int[] A) {\n        final int N = A.length;\n        if(N == 1) return A[0];\n        int start = 0, end = N-1, mid;\n        while(start < end){\n            mid = (start+end) / 2;\n            if(mid > 0 && A[mid] < A[mid-1]) return A[mid];\n            if(A[start] <= A[mid] && A[mid] > A[end]) start = mid + 1;\n            else end = mid - 1;\n        }\n        return A[start];\n    }\n}\n```\n# C :-\n -- | Details | --\n--- | --- | ---:\n**Runtime** | 1ms | Beats **100%**\n**Memory** | 6MB | Beats **30%**\n```\nint findMin(int* A, int N){\n    if(N == 1) return A[0];\n    int start = 0, end = N-1, mid;\n    while(start < end){\n        mid = (start+end) / 2;\n        if(mid > 0 && A[mid] < A[mid-1]) return A[mid];\n        if(A[start] <= A[mid] && A[mid] > A[end]) start = mid + 1;\n        else end = mid - 1;\n    }\n    return A[start];\n}\n```\n## Please UPVOTE : |\n![waiting-tom-and-jerry.gif](https://assets.leetcode.com/users/images/4f0cc754-71e1-4cfc-816b-36a94c20b17f_1678366238.9546802.gif)
['Array', 'Binary Search', 'C', 'Java']