Maximum Average Subarray (LeetCode 643) | Sliding Window Algorithm | Full solution with animations

Sdílet
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

Komentáře • 68

  • @dexterjohnson1842
    @dexterjohnson1842 Před 6 měsíci +14

    This video is my first introduction to sliding window, and you explained it very, very well. Thank you!

    • @nikoo28
      @nikoo28  Před 6 měsíci

      Glad it was helpful!

  • @samyaknagrale9566
    @samyaknagrale9566 Před 11 měsíci +13

    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 ❤❤❤🎉🎉🎉

    • @nikoo28
      @nikoo28  Před 10 měsíci

      thanks for the kind words :)

  • @dgod245
    @dgod245 Před 10 měsíci +6

    not even needcode fully explains problems like this, your explanations are so concise and very easy to understand

    • @nikoo28
      @nikoo28  Před 10 měsíci

      so glad you feel this way

  • @matthewlau3551
    @matthewlau3551 Před 7 měsíci +1

    seriously good video, subscribed!

  • @heenakhan295
    @heenakhan295 Před 10 měsíci +1

    Probably the best explanation of a dsa problem . Keep up the good work.

  • @toprakgungor131
    @toprakgungor131 Před 10 měsíci +3

    simple and basic, loved it

  • @AnuragKumar-qh5de
    @AnuragKumar-qh5de Před 14 dny

    bada badiya say samjvat balv ho bhiya tohra kay bhagwan salmat rakhay aur turhera kay mehraru badiya dey ehay hamar bhagwan say gujris ba

  • @berntalz1093
    @berntalz1093 Před 17 dny

    Ok wow!! the explanation is pure class in this video.
    Surely going to watch your videos for any doubts.

  • @arslanmuhammad4190
    @arslanmuhammad4190 Před 11 měsíci +12

    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.

    • @nikoo28
      @nikoo28  Před 11 měsíci +2

      So nice of you

    • @nerduser1000
      @nerduser1000 Před 7 měsíci

      i second this nikhil !
      I immediately search for your solution video whenever I'm stuck in a problem!

  • @fahimimtiaz9129
    @fahimimtiaz9129 Před 4 měsíci +1

    Bro your videos are so good, god gifted talent!

  • @ghanshyamoza5316
    @ghanshyamoza5316 Před 9 měsíci +1

    Thank you for the beautiful explanation. Got it very easily👍

  • @Lumiyo_
    @Lumiyo_ Před 2 měsíci +2

    Love the video its rlly well explained as someone who is reviewing this problem.

  • @nandiniverma5273
    @nandiniverma5273 Před 6 měsíci +2

    I always struggle understanding sliding window problems, but you made it easier thanks !!

  • @derrickagyemang1259
    @derrickagyemang1259 Před 8 měsíci +1

    Well explained, thanks for the video

  • @arunbalakrishnan8978
    @arunbalakrishnan8978 Před 2 měsíci

    Great explanation. Need more explanations like this, not solve a problem. Once we understand the algorithm we can solve any problem. Thank you,

  • @mayankbadika3101
    @mayankbadika3101 Před 6 měsíci +1

    Very good Explanation. Thanks a lot 👍

  • @jeet6973
    @jeet6973 Před 8 měsíci

    Now I'm loving CP Awesome Explanations Thanks A Lot Sir!!❣

  • @RohanKumar-vc5ii
    @RohanKumar-vc5ii Před 4 měsíci +1

    Bhai, you have explained it so well.
    Thanks a lot for the video.

  • @myadventures7344
    @myadventures7344 Před 4 měsíci

    Thank you very much! As a beginner, i found this explanation very helpful!

  • @NightCityBeats
    @NightCityBeats Před 4 měsíci

    🔥great explanation

  • @DeroCodes
    @DeroCodes Před 17 dny

    I cannot thank you enough !

  • @missbluesky2512
    @missbluesky2512 Před měsícem

    Great video as always. Sir, you're an amazing teacher 💯

  • @atvmoviedigest
    @atvmoviedigest Před 2 měsíci

    great explanation man

  • @congdatt
    @congdatt Před 3 měsíci

    Nice explain. Keep it up bro !!!

  • @vinaf4494
    @vinaf4494 Před 8 měsíci

    thank you! you explain in a very clear way!

  • @christopherkhajira1540
    @christopherkhajira1540 Před 3 měsíci

    Very great value

  • @dhananjay9923
    @dhananjay9923 Před 9 měsíci

    very informative and clear to unserstand
    😀

  • @damankumar2129
    @damankumar2129 Před měsícem

    Great explanation 👌 👍

  • @mowli3885
    @mowli3885 Před 3 měsíci

    great explanation

  • @Mohit-fe5hx
    @Mohit-fe5hx Před měsícem

    It was Awesome explanation....

  • @sandeep_dev
    @sandeep_dev Před 9 měsíci

    Great explanation

  • @farhanali4623
    @farhanali4623 Před 11 měsíci +2

    till now its best channel for DSA awesome explanation bhai

    • @nikoo28
      @nikoo28  Před 10 měsíci

      Thank you so much 😀

  • @ekremyilmaz9694
    @ekremyilmaz9694 Před 14 dny

    you're on fire dude

  • @subee128
    @subee128 Před 6 měsíci

    Thank you

  • @udayrajvadeghar8555
    @udayrajvadeghar8555 Před 3 měsíci

    Best explanationnnn

  • @Md_sadiq_Md
    @Md_sadiq_Md Před 11 měsíci +1

    Pushing the algorithm ❤️

  • @iOS1927
    @iOS1927 Před 5 měsíci

    thank you

  • @Sai-fn4lq
    @Sai-fn4lq Před 8 měsíci

    Massive Respect to you sir!!! 😇

    • @nikoo28
      @nikoo28  Před 8 měsíci

      thanks for your kind words.

  • @hardiksharma1412
    @hardiksharma1412 Před 5 měsíci +1

    you are great

  • @ramujanak963
    @ramujanak963 Před 5 měsíci

    awesome sir....do more videos like this...🙌🙌

    • @nikoo28
      @nikoo28  Před 4 měsíci

      a new video every week

  • @ruibinzhang
    @ruibinzhang Před 2 měsíci

    Could you also please explain question 644?

  • @fahimioo
    @fahimioo Před 5 měsíci +1

    If someone somehow watches your video, he will definitely stick to this channel.

  • @komalpatel4029
    @komalpatel4029 Před 6 měsíci

    The explanation is very good . one suggestion- can you please explain time/space complexity of bruteforce solution as well.

    • @nikoo28
      @nikoo28  Před 6 měsíci +1

      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.

  • @appy973
    @appy973 Před 5 měsíci

    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.

  • @inspiredomkar1239
    @inspiredomkar1239 Před 11 měsíci +1

    Hi . Have you given wrong code in the description , when I click on the link it is showing isSubsequence code.

    • @nikoo28
      @nikoo28  Před 11 měsíci +1

      thanks for pointing that out. I have fixed it. :)

  • @CPS_XI
    @CPS_XI Před 4 měsíci

    💯❤

  • @tirupatirao7521
    @tirupatirao7521 Před 11 měsíci +2

    A special series on Graphs will be helpful Sir

    • @nikoo28
      @nikoo28  Před 10 měsíci +1

      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.

    • @nikoo28
      @nikoo28  Před 5 měsíci

      The complete playlist on graphs is now available: czcams.com/play/PLFdAYMIVJQHNFJQt2eWA9Sx3R5eF32WPn.html

  • @bossmusa9075
    @bossmusa9075 Před 11 měsíci +1

    if i found this video as slide windows tutorial and not as 643 leetcode problem, then i would probably understand window slide algorithm faster

    • @nikoo28
      @nikoo28  Před 10 měsíci

      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 :)

  • @arslanmuhammad4190
    @arslanmuhammad4190 Před 11 měsíci +1

    By the way You look handsome without Cap.😍😝

  • @arslanmuhammad4190
    @arslanmuhammad4190 Před 11 měsíci +1

    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.

    • @nikoo28
      @nikoo28  Před 10 měsíci +2

      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.

  • @rishabhjain7651
    @rishabhjain7651 Před 11 měsíci

    {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 .

    • @nikoo28
      @nikoo28  Před 10 měsíci

      yes, I will add it to my pipeline of videos.