Given a sorted (ascending) integer array nums of distinct values and an integer target, return the index of target, or -1 if it is not present. Your algorithm must run in O(log n).
Input
nums (sorted, distinct)targetOutput: the index, or -1.
-1 0 3 5 9 12 9
4
-1 0 3 5 9 12 2
-1
Run your code against the sample tests, or Submit to run the full suite.