← Questions

Sliding window maximum

0
AmazonCodingLast asked Aug 2026
  1. Given an array and a window size k, return the maximum of every window of k consecutive elements.
  2. As a class: put(number) adds a number to a stream and getMax() returns the largest of the last k numbers put.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding