Dsa
Sliding Window
Easy
Sum of All Unique Integers in Sliding Window
You are given an array of integers and a window size k. Write a function that returns the sum of all unique integers in each sliding window of size k. The final output should be a list of integers representing these sums for each window position.
Example:
Input:
3
1 2 2 3 4
Output:
[6, 9, 8]
Key concepts
sliding_windowsetsum
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now