First and Last Position

Searching ยท medium

Given a sorted array `nums`, implement `searchRange(nums, target)` returning `[first, last]` indices of `target`, or `[-1, -1]` if absent.

Learning resources

Loading...

Run your code to see results.