Given a sorted array
nums and a target value target, return the index of the element or -1 if it is not found.Example 1
Input: nums = [-1,0,3,5,9,12], target = 9
Output: 4
Explanation: 9 is at index 4.
Output: 4
Explanation: 9 is at index 4.
Example 2
Input: nums = [-1,0,3,5,9,12], target = 2
Output: -1
Explanation: 2 is not in the array.
Output: -1
Explanation: 2 is not in the array.