public int findMin(int[] nums) {

		if (nums.length == 0)
			return -1;
		if (nums.length == 1)
			return nums[0];
		int s = 0;
		int e = nums.length - 1;

		while (s < e) {
			int m = (s + e) / 2;
			if (s > m - 1) { // only two left;
				return Math.min(nums[s], nums[e]);
			}
			if (nums[m] < nums[m - 1])
				return nums[m];
			else if (nums[m] > nums[e])
				s = m + 1;
			else
				e = m - 1;

		}
		return nums[s];
	}