LeetCode 239. Sliding Window Maximum | Sliding Window Maximum LeetCode | Deque Solution | O(n)

preview_player
Показать описание
⚡️My Courses on Udemy:

🈚️ BEST RESOURCES FOR SOFTWARE ENGINEERING PREP

📝Statement: 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.

✅️BEST RESOURCES FOR SOFTWARE ENGINEERING PREP

✔️EQUIPMENT I USED IN THIS VIDEO:

✴️PRACTICE CODING QUESTIONS

❇️FREE RESOURCE ONLINE

⚡ Please leave a LIKE and SUBSCRIBE for more content! ⚡

⭐ Tags ⭐
- LeetCode
- CS Ninja
- Software Engineering
- LeetCode 239
- Sliding Window Maximum
- 239. Sliding Window Maximum
- Sliding Window Maximum Java
- Sliding Window Maximum Python
- Sliding Window Maximum LeetCode
- Sliding Window Maximum LeetCode Java
- Sliding Window Maximum LeetCode Python

⭐ Hashtags ⭐
#leetcode

Disclosure: Some links are affiliate links to products. I may receive a small commission for purchases made through these links. #csninja
Рекомендации по теме
Комментарии
Автор

I didn't understand clearly how deque works. And now I can finally understand !!! Thx CS Ninja~! You got a new subscriber ! :)

minsupark
Автор

hi guys, your explantion is so good, from the simple solution to the better solution,

huansir
Автор

Please work on your naming conventions (e.g. decreasingWindow), and try to apply a little bit of OOPs (e.g. create Window class which directly deals with values not indices).

palashdas
Автор

Hi,
Can you please explain what this line of code is doiing?
while(deque.size() > 0 && deque.peekFirst() <= i-k)
deque.pollFirst();

shashankshekhar