Problem 3134 · Hard

Find the Median of the Uniqueness Array

Binary search the distinct-count value and count subarrays with at most that many distinct numbers using a sliding window.

Open the interactive visualisation