Problem 992 · Hard

Subarrays with K Different Integers

Count contiguous subarrays that contain exactly a given number of distinct values. The visual shows a window with a count of each value inside it.

Open the interactive visualisation