67. First and Last Position in a Sorted Array
MediumSearching
Given a sorted array that may contain duplicates, return the first and last index of target, or [-1, -1]. Use O(log n).
Example 1
Input: nums = [5, 7, 7, 8, 8, 10], target = 8 Output: [3, 4]
Constraints
0 ≤ nums.length ≤ 10⁵