Given a sorted (non-decreasing) integer array A of length n, return all distinct values that occur strictly more than n/3 times. Design an algorithm that runs in O(log n) time and uses O(
-
extra space. Answer the following:
(
-
Prove there can be at most two such values.
(
-
Describe how to choose candidate positions and confirm counts using binary searches (e.g., lower_bound/upper_bound).
(
-
Provide correctness and complexity analysis.