Sponsored
Solve with full IDE support and test cases
Use these hints if you're stuck. Try solving on your own first.
Use a set/heap to keep track of distinct element counts.