Easy · Binary search

Binary Search

Given a sorted array and a target, return the index of the target, or -1 if it is not there. Run in O(log n).

nums = [-1, 0, 3, 5, 9, 12], target = 9

→ 4
Record your take

1 way to solve it.