O(logn) solutions for both Search in Rotated Sorted Array I and II

The idea is simple: first use binary search to find out the minimal element in array nums, as the minimal element divides nums into two sorted arrays, then we still use binary search to locate the target.