array rotated search, just like binary search