โ† Amazon questions

Count Distinct Integers in Contiguous Subsequences of Size K

Filed under Amazon

Given an array of integers and an integer K, return an array or list containing the number of distinct integers in every contiguous subsequence (sliding window) of size K.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.