Binary Search

Given a sorted array of integers and a target value, return the index of the target if it exists; otherwise return -1.

Examples

Example 1:

Input:

nums = [1,3,5,7]
target = 3

Output:

1
Loading...
Binary Search - Binary Search DSA Problem