Algorithm Atlas

Preparing your learning space

Checking your account, lessons, and saved progress. The server is starting after a long break. This first cold start may take 5–10 seconds

Subarray With K Distinct Integers: step-by-step visual explanation

Learn the Subarray With K Distinct Integers problem with a step-by-step DSA animation. Follow the Sliding Window solution with synced C#, Python, and Java code.

Sliding Window pattern

The window can stay the same size, or grow and shrink when a rule changes.

Difficulty: Hard · Approach: Exactly K kinds

Open Algorithm Atlas to watch the full interactive lesson and follow every execution step.

More Sliding Window lessons