LeetCode: search rotated sorted array, remove duplicates in sorted array