Binary Search

Given a sorted array of distinct integers in ascending order and a target value, return the 0-based index of the target. Return -1 when the target is not present. Your algorithm must run in O(log n) time.

Examples
Input: [[],0]
Output: -1
Hints

Binary Search

Given a sorted array of distinct integers in ascending order and a target value, return the 0-based index of the target. Return `-1` when the target is not present. Your algorithm must run in `O(log n)` time.