Finding the min element in a rotated array