Find minimum in rotated sorted array using the gradient