LeetCode | 239. Sliding Window Maximum | Monotonic Queue

preview_player
Показать описание
You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position.

Return the max sliding window.

#leetcode #dsa #monotonicqueue #queue
Рекомендации по теме
Комментарии
Автор

When you slide window, you will have to remove i-k th index, but its not necessary that this index is always in front..what if its in the middle???

xxvv-nzko