2dbi

Sliding Window Maximum

viaLeetCode

Given an array nums and a sliding window of size k moving from the left to the right of the array, return the maximum value in each window position. Aim for an O(n) solution using a deque.

Add a follow-up question they asked
No follow-ups yet. Be the first to add one.
asked …
LeaderboardSalary
Language
Account