Binary Search

EASY

Binary 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