I would use binary search as the time complexity of this method is O(log n). First, I would set up two pointers, left and right , at the start and end of the array for finding mid index. Then I calculate the mid index, which allows me to find out whether the target is larger or smaller than the mid value. If the target is larger, I move left to mid + 1. If smaller, I move right to mid - 1. If equal, we return the index. Because the array is sorted, we can discard half of the array each iteration. We repeat this until left exceeds right, which means the target doesn't exist in the array