Find First and Last Position in Sorted Array
Given a sorted array of integers and a target value, return the starting and ending position of the target in the array as [start, end]. Return [-1, -1] if the target is not found. The algorithm must run in O(log n) time.
Enable JavaScript for the full StreamPrep guide.