Given a sorted array of integers nums of length n, return all values that occur more than floor(n/
3) times. Design an algorithm that runs in O(log n) time and O(
extra space. Justify correctness, cover edge cases (e.g., n < 3, runs near boundaries), and provide time/space analysis.