Your question is Search in Rotated Sorted Array. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given a rotated sorted array of distinct integers, implement a function that returns the index of a target value or -1 if it is not present. The solution must run in O(log n) time, so a linear scan is not acceptable.