Maximum of all subarrays of size k | Sliding Window
Aditya Verma Aditya Verma
251K subscribers
224,222 views
5.5K

 Published On Nov 17, 2020

Patreon Link:   / adityaverma  
Video Pdf Notes And Code:   / 43956990  

Playlist Link:    • Sliding Window Algorithm | Face to Fa...  

Problem Description: https://www.interviewbit.com/problems...


Given an array arr[] of size N and an integer K. Find the maximum for each and every contiguous subarray of size K.

Example:

Input 1:
A = [1, 3, -1, -3, 5, 3, 6, 7]
B = 3
Output 1:
C = [3, 3, 5, 5, 6, 7] .
------------------------------------------------------------------------------------------
Here are some of the gears that I use almost everyday:

🖊️ : My Pen (Used in videos too): https://amzn.to/38fKSM1
👨🏻‍💻 : My Apple Macbook pro: https://amzn.to/3w8iZh6
💻 : My gaming laptop: https://amzn.to/3yjcn23
📱 : My Ipad: https://amzn.to/39yEMGS
✏️ : My Apple Pencil: https://amzn.to/3kMnKYf
🎧 : My Headphones: https://amzn.to/3kMOzM7
💺 : My Chair: https://amzn.to/385weqR
🛋 : My Table: https://amzn.to/3kMohtd
⏰ : My Clock: https://amzn.to/3slFUV3
🙋🏻‍♀️ : My girlfriend: https://amzn.to/3M6zLDK ¯\_(ツ)_/¯

PS: While having good gears help you perform efficiently, don’t get under the impression that they will make you successful without any hard work.

show more

Share/Embed