ByteByteGo logo
menuProblems List

Maximums of Sliding Window

Hard

There's a sliding window of size k that slides through an integer array from left to right. Create a new array that records the largest number found in each window as it slides through.

Example:

Input: nums = [3, 2, 4, 1, 2, 1, 1], k = 4
Output: [4, 4, 4, 2]

You can practice coding exercises online by logging into bytebytego.com on your laptop.