Given a sorted ascending array `nums`, implement `search(nums, target)` returning the index of `target`, or `-1` if absent.
+ 1 hidden test run on Submit.
Binary search halves the range each step. O(log n) time, O(1) space.
Run your code to see results.