Given a sorted array of integers, search for a target integer. If the target exists, return its index; otherwise, return -1. The algorithm must have O(log n) runtime complexity.
Click Run to execute sample tests.