Model answer
Run a lower-bound search for the first index with value≥target and verify equality. Run an upper-bound search for the first value>target; the last occurrence is upper−1. Both searches are O(log n).
Use the key terms, then explain the reasoning.