Valid K-Unique Subarrays I
For each range, count the values inside it: the range is valid when there are exactly k distinct values and every count is even.
For each range, count the values inside it: the range is valid when there are exactly k distinct values and every count is even.