You are given an integer array, nums, that is sorted in non-decreasing order. Your task is to find the first and last indexes of a given value, target, within this array.
If the target does not appear in the array at all, return [-1, -1].
Note: You must write an algorithm with
runtime complexity.
Constraints:
nums.length
nums[i]
nums is a non-decreasing array.
target
You are given an integer array, nums, that is sorted in non-decreasing order. Your task is to find the first and last indexes of a given value, target, within this array.
If the target does not appear in the array at all, return [-1, -1].
Note: You must write an algorithm with
runtime complexity.
Constraints:
nums.length
nums[i]
nums is a non-decreasing array.
target