Maximum Average Subarray (LeetCode 643) | Sliding Window Algorithm | Full solution with animations
Vložit
- čas přidán 9. 07. 2024
- Actual problem on HackerRank: leetcode.com/problems/maximum...
Chapters:
00:00 - Intro
00:42 - Problem statement and description
03:24 - Different scenarios and Brute Force Approach
06:04 - Efficient solution (Sliding Window Algorithm)
08:49 - Dry-run of Code
12:13 - Final Thoughts
📚 Links to topics I talk about in the video:
Brute Force: • Brute Force algorithms...
Problems on Arrays: • Arrays
Other Easy Difficulty Problems: • Easy Problems
📘 A text based explanation is available at: studyalgorithms.com
Code on Github: github.com/nikoo28/java-solut...
Test-cases on Github: github.com/nikoo28/java-solut...
📖 Reference Books:
Starting Learn to Code: amzn.to/36pU0JO
Favorite book to understand algorithms: amzn.to/39w3YLS
Favorite book for data structures: amzn.to/3oAVBTk
Get started for interview preparation: amzn.to/39ysbkJ
🔗 To see more videos like this, you can show your support on: www.buymeacoffee.com/studyalg...
🎥 My Recording Gear:
Recording Light: amzn.to/3pAqh8O
Microphone: amzn.to/2MCX7qU
Recording Camera: amzn.to/3alg9Ky
Tablet to sketch and draw: amzn.to/3pM6Bi4
Surface Pen: amzn.to/3pv6tTs
Laptop to edit videos: amzn.to/2LYpMqn
💻 Get Social 💻
Follow on Facebook at: / studyalgos
Subscribe to RSS feeds: studyalgorithms.com/feed/
Join fan mail: eepurl.com/g9Dadv
#leetcode #programming #interview
This video is my first introduction to sliding window, and you explained it very, very well. Thank you!
Glad it was helpful!
I just have to say that i have searched for many channels and no one teaches like you do. The way you teach and explain is so clear that i understand concepts quickly and clearly! Keep up the good work ❤❤❤🎉🎉🎉
thanks for the kind words :)
not even needcode fully explains problems like this, your explanations are so concise and very easy to understand
so glad you feel this way
seriously good video, subscribed!
Probably the best explanation of a dsa problem . Keep up the good work.
simple and basic, loved it
bada badiya say samjvat balv ho bhiya tohra kay bhagwan salmat rakhay aur turhera kay mehraru badiya dey ehay hamar bhagwan say gujris ba
Ok wow!! the explanation is pure class in this video.
Surely going to watch your videos for any doubts.
I want say something to You sir, Your Views may be less and you also have less Subscribers. But Believe me sir, You are a legend. I Learned a lot from of You are Great sir. Please keep on doing for us we are unable to pay the fee of online lectures but you work is free for us. May GOD, be pleased with you, Give You a lot of happiness. Thanks sir. Really Love You.
So nice of you
i second this nikhil !
I immediately search for your solution video whenever I'm stuck in a problem!
Bro your videos are so good, god gifted talent!
Thank you for the beautiful explanation. Got it very easily👍
Love the video its rlly well explained as someone who is reviewing this problem.
I always struggle understanding sliding window problems, but you made it easier thanks !!
Great to hear!
Well explained, thanks for the video
Great explanation. Need more explanations like this, not solve a problem. Once we understand the algorithm we can solve any problem. Thank you,
Very good Explanation. Thanks a lot 👍
Now I'm loving CP Awesome Explanations Thanks A Lot Sir!!❣
Bhai, you have explained it so well.
Thanks a lot for the video.
Thank you very much! As a beginner, i found this explanation very helpful!
🔥great explanation
I cannot thank you enough !
Great video as always. Sir, you're an amazing teacher 💯
great explanation man
Nice explain. Keep it up bro !!!
thank you! you explain in a very clear way!
You're welcome!
Very great value
very informative and clear to unserstand
😀
Great explanation 👌 👍
great explanation
It was Awesome explanation....
Great explanation
till now its best channel for DSA awesome explanation bhai
Thank you so much 😀
you're on fire dude
Thank you
Best explanationnnn
Pushing the algorithm ❤️
thank you
Massive Respect to you sir!!! 😇
thanks for your kind words.
you are great
awesome sir....do more videos like this...🙌🙌
a new video every week
Could you also please explain question 644?
If someone somehow watches your video, he will definitely stick to this channel.
The explanation is very good . one suggestion- can you please explain time/space complexity of bruteforce solution as well.
I usually talk about it when needed. All brute force algorithms need not be implemented and you cannot say what will the time complexity. Whereas the efficient solution is the fastest, and that is why we can talk about it.
It was the best explanation I've come across for this solution but this solution is not working for leetcode 643 problem as I'm getting output 1.00000 instead of getting 12 .75
Could you please look and advise on this.
Hi . Have you given wrong code in the description , when I click on the link it is showing isSubsequence code.
thanks for pointing that out. I have fixed it. :)
💯❤
A special series on Graphs will be helpful Sir
I am prepping up for the graph series. Need to design a course in my mind before I can have all of it in videos. Thank you for being patient.
The complete playlist on graphs is now available: czcams.com/play/PLFdAYMIVJQHNFJQt2eWA9Sx3R5eF32WPn.html
if i found this video as slide windows tutorial and not as 643 leetcode problem, then i would probably understand window slide algorithm faster
actually the sliding window is a bit more diverse concept, and it covers a lot more topics. I would create a video on that too...until then this just touches the base :)
By the way You look handsome without Cap.😍😝
Sir, I am Doing DSA with JS. I was learning it my own I solved a lot problems. But I am unable to understand AVL Tree and I spend 10 days to learn that but fail. Will You please make a video on AVL Tree.
to be very honest, if you are facing problems with AVL trees, you can leave them. They are hardly ever asked in coding interviews, and they do not have real life implementations as well.
I don't yet have a video for AVL tree in the pipeline...but will try if needed.
{First negative integer in every window of size k} please make a video of this problem also this problem is also related to Sliding Window Algorithm .
yes, I will add it to my pipeline of videos.