Interview Guides

Given a sorted array of integers nums in non-decreasing order and an integer target, return a list of two integers representing the first and last index of target in nums. If target does not exist in the array, return [-1, -1]. Your solution should run in O(log n) time.
0 <= nums.length <= 10^5-10^9 <= nums[i] <= 10^9nums is sorted in non-decreasing order-10^9 <= target <= 10^9O(log n)