9-line java code, beats 95.14% run times
if the array is indeed rotated by some pivot, there are only 2 possibilities\n\n> 1. a[mid] > a[left] && a[mid] > a[right], meaning we are on the bigger part, t
if the array is indeed rotated by some pivot, there are only 2 possibilities\n\n> 1. a[mid] > a[left] && a[mid] > a[right], meaning we are on the bigger part, the smaller part is on our right, so go right\n\n> 2. a[mid] < a[left] && a[mid] < a[right], meaning we are on the smaller part, to find the smallest element, go left\n\nif the array is not rotated (actually one rotating cycle completed), we just need to go left, in this case a[mid] < a[right] always holds.\n\ncombining the cases above, we conclude that\n> if a[mid] > a[right], go right; if a[mid] < a[right], go left.\n\n    public class Solution {\n        public int findMin(int[] nums) {\n            if (nums==null || nums.length==0) { return Integer.MIN_VALUE; } \n            int left = 0, right = nums.length-1;\n            while (left < right-1) {  // while (left < right-1) is a useful technique\n                int mid = left + (right-left)/2;\n                if (nums[mid] > nums[right]) { left = mid; }\n                else { right = mid; }\n            }\n            if (nums[left] > nums[right]) { return nums[right]; }\n            return nums[left];\n        }\n    }
['Java']