Leetcode problem: Search in a rotated array (classic problem)