Question DSA-TP-0049
MediumFor sliding windows with a fixed size k, how is the next window sum obtained?
- A.
Sort the window
- B.
Multiply by k
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Two Pointers and Sliding Window question
For sliding windows with a fixed size k, how is the next window sum obtained?
Sort the window
Multiply by k
Sign up free to see the answer and a step-by-step explanation.
Add the new element and subtract the one leaving the window
Recompute the whole sum