Sliding Window Technique - Algorithmic Mental Models
HTML-код
- Опубликовано: 14 июл 2024
- Please support me on Patreon: / thesimpleengineer
/ thesimpengineer / schachte
ryan-schachte.com
Don't forget to subscribe! Code:
gist.github.com/Schachte/87d7...
In this video, we'll begin our series of algorithmic mental models and cover the idea behind the sliding window technique. This technique allows us to reduce a typical n^2 algorithm to a linear time algorithm with minimal effort. This exploits linear time optimizations on data structures that deal with iteration and group sequential pieces of data together.
More resources:
/ sliding-window-technique
thesimpleengineer.com
stackoverflow.com/questions/8...
Timestamps
00:00 Welcome
8:25 Maximum sum of contiguous subarray of size 3.
16:35 Question variants
24:50 Dynamic variant. Smallest subarray with given sum.
27:45 Smallest subarray code start
32:48 Smallest subarray solution
33:20 Longest substring with length k distinct characters
One of the best explanations of this concept. Please make some more "Algorithmic Mental Models" based videos.
dude u seriously need to make more of these. Ill pay for them.
Agreed! These are great. More "Algorithmic Mental Models" for dynamic programming, backtracking, etc. would be extremely helpful.
Thanks for the video!
it is not one of the best, it is the best
@@CEOofTheHood Yes. Please make more of these. Especially with your new freecodecamp traffic this would really take off.
I've never before seen a CS video that approached CS like math (i.e., here are the concepts, here are some keywords to look out for so you know when to apply these concepts, here are a few examples). The world needs 1,000 more videos like this (DP, Linked Lists, Trees, Graphs, etc). Fantastic work!
I loved, looooved the format of this! Please continue to do these videos. Extremely helpful!!
I love this format, thank you for putting this together. Keep them coming!
This is fantastic! Please make more of these 'mental model' videos. There too many videos out there that jump straight to the solution without any discussion of how to approach and generalize a problem. We need more video's like this!
One of the best tutorials I have even seen. Thanks.
One of the The best videos to explain Sliding windows concept. Request you to make other such videos that will help in tech interviews.
Thank you, Ryan! Your explanation and visuals are simply great.
Was struggling a lot with sliding window problems earlier, your explanation really simplified those problems. I really appreciate your effort. Thank you! Please post more videos.
This is really the best video (or any, really) explanation of the topic I have found. Really hope this would become more popular. Thank you!
This is an awesome, thorough explanation of the sliding window concept and is easy to follow!
Please make more algorithm videos, you're literally the best explainer I have found on youtube.
Thank you so much! I finally understood "Sliding Window" technique.
Thanks for the super explanation dude. I really appreciate the amount of work you put into this video for us'all. Thanks again!
This is the best video I have ever seen on an algorithmic topic!! Please make more content like this!! Love the idea of the algorithmic mental model! :))
we need more of this series! please do more!
I'm absolutelly blown away how this is explained.
I wouldn’t resist to pay a 1000$ to watch such videos. Brilliant piece of work! Hope you do more videos on “Mental models”
Great guy. I was hesitant to watch the whole video but you were so informative that I actually learned something for many use cases. Thanks
This is -by far- the best video on this topic I have seen. Thanks for taking the time to produce such a great content. Keep it up!
a simple visual explanation,
detailed, with variants
this is amazing, thank you
Best sliding window video ever! Thank you so much! Your implementation is so elegant too. Please make more videos to cover more topics, like DP, backtracking, prefix sum, etc
Excellent explanation. The animations really drove it home.
Hands down the best explanation of the Sliding Window technique. Please do more algorithmic mental model videos!
Please make more videos like this, it's one of the best things I've seen on youtube
Best video on youtube about sliding window technique. Thank you so much.
This is the best explanation on Sliding Window I have seen so far. Thank you for the detailed yet simple approach to explaining the concept.
wow this deserve to be a series very underrated!
This video is pure gold!!! Great explanation . Everything is very clear. Thank you very much!
Great explanation and thanks a lot. The way you visualized really helped to understand the concept.
One of the best and easy explanations of this concept. thank you so much !
I greatly appreciate the clear explanation of the dynamically resizable sliding window, it cleared up some doubts I have about the algorithm. Cheers!
Hands down the best explanation. Subscribed. Keep posting.
Superb work. This is truly the best explanation I have found in the web. I really hope you make more such videos
Amazing video. I have never heard of this algorithm before and now I can use it. Thanks a lot. Will stay tuned for more videos :)
Rewatched some parts of it. Perfect, breathtaking. The best tutorial ever.
The animation for second technique: dynamic SW is just awesome, I loved it
I have always been calculating the first windowSum in a separate loop before starting to "move" the window in a separate loop. I never knew you could do both within the same loop without using a nested loop. This is amazing!
Amazing instruction. Not a single word was wasted. I’m only halfway through and had to comment already! Please make more algorithm videos! :-)
I have struggled with this concept for a really long time, but not anymore :) Your explanations were absolutely beautiful and I'm excited to solve some sliding window problems now! Can you please create more Algorithmic Mental Model videos? We'd all be super grateful!
Great explanation! I'm a visual learner and I can see myself imagining these sliding window animations when I face array problems like this in the future.
what a comprehensive video! Learnt a lot, liked and subbed. Keep bringing new content, you teach really good!
Great explanation and right format for learning new things, Thank you so much
first vid i see on this channel and its wonderful. good job!
Thanks a lot, great explanation. I have been looking for RUclipsrs like you all the time, good explanations with good content :D
This is really high qulity content, detailed explaination and very well presented. Hope you make more content like this. cheers
Great content. I like how you focused on approach and technique towards problem solving, rather than just providing the code.
Amazing explanation of the Sliding-Window Technique. Would love to see more of Algorithmic Mental Models.
Clear simple explanation, very easy to follow, thank you !!
I found "Algorithmic mental models" is a great concept for solving problems please bring more videos like this.
The best video on the sliding window I have seen so far. You made my day/future :-)
Dude, thank you so much for making those videos!
Great explanation for the problems! Code is concise!
Thank you @Ryan Schachte for clarifying the sliding window technique and make it so simple just like that.
I hope you upload a lot more vids like this bro !
this is the best video I was watching about sliding window - thank you !!
Best explanation so far. Thank you
This video is amazing. hope you make more videos on "mental models" such as for dynamic programming.
Max subarray sum of k is also a dynamic programming problem. You reuse the previous max result and update it. So it is like dynamic programming with space complexity O(1).
This is the only video which made me understand dynamic window sizing algorithm... Thank you so much 🥰
More of this -- this was fantastic.
the best lecture available on any platform for SWT.
I loved this video and your way of explanation.
dude I am only 2 minutes in and I've liked and subscribed! Between the visuals and your consice explanations, the sliding window technique (which I never thought I'd understand) makes SO MUCH SENSE! Thanks so much :)
Literally the best explanation of sliding window technique.
I've really struggled visualizing this algorithm concept and this video is extremely intuitive and detailed. Would love to have more of these videos.
Thanks you with tear. You constructed a solid framework for handling sliding window in my head.
Saved my day, man! Thanks a lot
This is the best video I've ever seen on this topic "sliding window"! It does not only solve one or two interview questions for me but also solves a group of problems. More than that, it teaches me how to spot this group of problems. Fantastic!!!
Great explanation, didn't know anything about sliding window before this video and I got enough information where I could implement it no problem.
Best explanation so far
This video finally cleared the cobwebs for me. Fantastic job explaining this!
Nice video! Banger as a refresher for interviews.
Please make more of these! This was so helpful thank you.
Very well explained. Keep it up!
What a beautiful animation, thank you so much ❤️🙏
Nice explanation. I am glad I landed here while searching for all possible solutions for solving the array problems
A series of algorithmic mental models would be awesome, great work!
Hand down, the best explanation. Great work🎉 thank you❤
You might be a professor or a normal student, but your explanation skills are exceptional. Add to that most of the videos explaining algorithms do not include such an amazing visualization for the data structures that we are working with. I hope one day you will have the free time to make a full algorithms and data structures for competitive programming course with such an amazing visualization. Hope you the best sir whereever you are.
The best lecture on sliding window technique
I like that you actually name your variables in a meaningful way. 👍
Thanks for the great explanation! Please post more patterns to ace coding interviews!
This one was really helpful!
Wow great explanation, love the ‘teach a man to fish’ approach to the algorithm problems!
After watching this one, I could solve even the hard LC problems within 15-20 mins. This is a gem of a video on this topic. Hope you make more of these on other topics, I will literally pay for it
Great explanation. It really helped me to fully understand
The best explanation I've ever seen, tysm.
Only 219k views... no way. This is by far some of the best CS-related content on RUclips, hands down. Amazing!!
very declariative and well explained , thanks
What an excellent, well paced, well explained video with explaining the theory but also showing it in examples
THANK YOU!
The more you research the more you come to understand that trying to solve all these problems individually with out knowing about techniques like these, is so painful lol
wow, this is amazing. thank you so much
This is amazing. I wish I could hug you for this best explainantion. I learned a lot.
Dude this is so good!
Amazing explanation, I like your code implementing clean and concise
I love the idea of "Algorithmic Mental Models"! Thank you so much for explaining this perfectly and I'd love to see more videos for this idea!
Thank you so much for this video, I helped me a lot to understand this concept better.
Excellent video!
Great use of graphics to explain the algorithm! :D
You are one of the best online tutor Man, I really appreciate it. Thanks for your contribution. Subscribed :)
Thanks for the kind words Roshan!
Explaind the Topic in an easy manner .Enjoyed the vedio and Found Really Helpful.
Dude please create a playlist for the other techniques as well!!! This is gold!
Does he have a playlist for this?
This is GOLD!
Thanks alot!!!
One of the best explanation on YT