First and Last Position
In a sorted array (with duplicates) find the first and last index of (0-based), or -1 -1.
Input
and the sorted array, then .
Output
Two indices.
Constraints
Sample 1
Input
6 5 7 7 8 8 10 8
Output
3 4
Sample 2
Input
6 5 7 7 8 8 10 6
Output
-1 -1