Algorithm · ByteDance · Medium
This assessment contains three independent array tasks. Implement each one according to the contract described in its section. Part 1: Search for a target in a sorted array You are given an integer array nums sorted in non-decreasing order and an integer target. If target exists in nums, return any index where it appears. If it does not exist, return -1. Example 1: Explanation: The value 11 sits at index 3. Example 2: Explanation: The array does not contain 7. Example 3:…
Checking your access…