Problem 4042 · Hard

Valid K-Unique Subarrays II

Tally the values in each queried range and accept it when it has exactly k distinct values, every one appearing an even number of times.

Open the interactive visualisation