Find the target with one binary search, then expand left and right to find boundaries.
The expansion step is where is the number of occurrences. If the entire array contains the target, that's .
The problem requires . You need a way to find each boundary directly.