Design a data structure for an array.
Answer queries: "How many times does value appear in ?" Example: Query returns (indices 1 and 7).
You're solving the frequency counting problem that wavelet trees handle efficiently. Constraints: up to elements, up to queries.