Find an element in a rotated sorted array.
Asked in the Technical stage. Implement a function that returns the index of target in a rotated, ascending array of distinct integers, or -1 if the target is absent.
nums, a non-empty list of distinct integers, and integer target.target, or -1.nums = [4, 5, 6, 7, 0, 1, 2], target = 0 returns 4.nums = [4, 5, 6, 7, 0, 1, 2], target = 3 returns -1.def search_rotated(nums, target):