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.
Binary search the distinct-count value and count subarrays with at most that many distinct numbers using a sliding window.