Problem 3795 · Medium

Minimum Subarray Length With Distinct Sum At Least K

Slide a window over the array, counting each distinct value once, and shrink it while its distinct sum stays at least k.

Open the interactive visualisation