Binary Search
EASYBinary Search
Given a sorted array of integers nums and a target, return the index if found, else -1.
Must run in O(log n).
Examples
Input: nums = [-1,0,3,5,9,12], target = 9
Output: 4
Given a sorted array of integers nums and a target, return the index if found, else -1.
Must run in O(log n).
Input: nums = [-1,0,3,5,9,12], target = 9
Output: 4