404. Search in Rotated Sorted Array
Given an array that is initially sorted in ascending order and then rotated at an unknown pivot point, you need to find the index of a target value in the array. If the target value is found, return its index; otherwise, return -1. It is guaranteed that there are no duplicate elements in the array.
The first line of input contains the size of the array. The second line contains the elements of the array. The third line contains the target value.
Print the index of the target element if found; otherwise, print -1.
7 4 5 6 7 0 1 2 0
The algorithm must have a runtime complexity of O(log n).