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 → 4Record your take
Easy · 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 → 4Record your take