Given a sorted array of integers nums in non-decreasing order and an integer target, return the index of target if it exists. If target is not present, return -1. The solution should run in logarithmic time.
Example 1:
Input: nums = [1, 3, 5, 7, 9], target = 7
Output: 3
Explanation: The value 7 appears at index 3.
Example 2:
Input: nums = [2, 4, 6, 8, 10], target = 5
Output: -1
Explanation: The value 5 does not appear in the array.
0 <= len(nums) <= 10^5-10^9 <= nums[i], target <= 10^9nums is sorted in non-decreasing orderO(log n) time