Minimum Window Substring | Sliding Window | LeetCode

Поділитися
Вставка
  • Опубліковано 10 лют 2025

КОМЕНТАРІ • 96

  • @megatronislive1331
    @megatronislive1331 Рік тому +3

    Cat !! The coder.
    Thank you catty for such a wonderful explanation

  • @kevindebruyne17
    @kevindebruyne17 3 роки тому +4

    Wow can't believe this cat is solving LC hard problems! Purrfect interviewee.

  • @christopherreyes3896
    @christopherreyes3896 3 роки тому +20

    I don’t usually comment but I want you to know these are very helpful, well explained, and entertaining! Thanks man.

    • @AlgosWithMichael
      @AlgosWithMichael  3 роки тому +4

      Thank you Chris! I'm not much of a commenter either when I am on UA-cam as a viewer either haha so I appreciate that

  • @mehdiLesty
    @mehdiLesty 3 роки тому +6

    I like the way you explain using algorithm walkthrough before coding (the coding part becomes naturally understandable since your first visual explanation is clear). Thumb smashed.

  • @AlancRodriguez
    @AlancRodriguez 3 роки тому +2

    I really like the visual effects you have implemented, not a lot of other UA-camrs have this

  • @MsSkip60
    @MsSkip60 4 роки тому +7

    Great explanation thanks! Loved the cat part :D

  • @interviewprep6827
    @interviewprep6827 3 роки тому +1

    Very clear explanation.. Actually 2 days back I saw this question on leetcode and was searching your channel to find the video... U read my mind.. Thanks a lot...

  • @sata1938
    @sata1938 2 роки тому +2

    Well done. I like that you spoke clearly, slowly and methodically. A lot of other similar types of videos have the narrator jumping around and explaining the solution on the fly. I really liked your intentional approach and how you visualized everything neatly.

  • @ShashankRustagiCSE
    @ShashankRustagiCSE 2 роки тому +1

    Honestly saying, I sighed when you said the most difficult to digest part of the algo is when we shrink the window and start incrementing when we find the characters in the map. You were right. Now i get the whole crux of the algorithm.
    This question was asked in Codenation(trilogy Innovation)

    • @AlgosWithMichael
      @AlgosWithMichael  2 роки тому +1

      Yeah it is pretty hard to conceptualize, looking at an animated example really helped

    • @ShashankRustagiCSE
      @ShashankRustagiCSE 2 роки тому

      @@AlgosWithMichael if you are on LinkedIn, please drop me your id

  • @kumarc4853
    @kumarc4853 3 роки тому

    for harder problems we come to Michael

  • @HKCSFARJADAHMEDKHAN
    @HKCSFARJADAHMEDKHAN 3 роки тому +1

    best explanation you can fi0nd on youtube for this problem . Great job .

  • @tharunkumarreddy1224
    @tharunkumarreddy1224 3 роки тому

    U xplained it in a trivial way !!keep up the good work🙌

  • @williamzayas302
    @williamzayas302 2 роки тому

    This was really helpful! I tried different approaches, but couldn't solve it. A+ for editing. I know how long editing takes and sometimes it's hard. Thanks for step by step explanation. Keep up the good work!! 👍

  • @girlingame518
    @girlingame518 3 роки тому +3

    i subscribed because of your cat 😁 , great explanation

  • @juliahuanlingtong6757
    @juliahuanlingtong6757 3 роки тому

    Greatest explanation and demonstration on sliding window!

  • @jasonli6057
    @jasonli6057 3 роки тому

    super helpful, first time comment in youtube

  • @boundlesstech5292
    @boundlesstech5292 2 роки тому

    The smartest cat on the internet fasho 🙂 lol

  • @afnanrehman866
    @afnanrehman866 10 місяців тому

    Thanks for the upload

  • @hoangchungduyminh7568
    @hoangchungduyminh7568 3 роки тому

    Liked and subscribed. Well-informative video, my applause.

  • @Manishgupta200
    @Manishgupta200 Рік тому

    That's understable. Thankyou

  • @gunahawk6893
    @gunahawk6893 2 роки тому

    glad i found ur channel

  • @tylercondon3453
    @tylercondon3453 3 роки тому

    very informative video
    thank you Michael

  • @hawaijarmayengbam4451
    @hawaijarmayengbam4451 2 роки тому

    Thank you, you made my day!

  • @CPAMJIO
    @CPAMJIO Рік тому

    thank you so much!!! great explaination

  • @mridulsetia4974
    @mridulsetia4974 3 роки тому

    Awesome Explanation!! Thanks

  • @gouravbansal994
    @gouravbansal994 3 роки тому

    Great Video Man!

  • @manuxgp
    @manuxgp 2 роки тому

    I got this as a coding challenge and failed it :( thank you if I ever encounter this I will be prepared now.

  • @ShahinAnsari-e6s
    @ShahinAnsari-e6s 11 місяців тому

    where did you get the sound clip for the error?

  • @Tamilsd629
    @Tamilsd629 3 роки тому +3

    Great Job Mike!! If you share the code . it will be more helpful.

  • @jasonahn8658
    @jasonahn8658 2 роки тому

    Best explanation! But HOLY it's difficult haha

  • @aniruddhkarekar2818
    @aniruddhkarekar2818 Рік тому

    You said we move i pointer forward to get rid of the useless characters from the prefix of our substring then why do we incremented the count at the 0th index which is character A and it should be present in the final answer ???

  • @tongwang535
    @tongwang535 3 роки тому +3

    Thank you very much! Could you talk about some design problems? like LRU

  • @abanerjee3704
    @abanerjee3704 Рік тому

    Purrfect!

  • @nayemalaboni8318
    @nayemalaboni8318 3 роки тому

    new subscriber you explain very well

  • @vinaysimha95
    @vinaysimha95 3 роки тому +2

    Small correction. I think you meant to say, space complexity is O(M) not O(N). (The length of string T is M)

    • @AlgosWithMichael
      @AlgosWithMichael  3 роки тому +1

      Yea you are right haha, thanks for pointing that out

  • @B-Billy
    @B-Billy 3 роки тому

    Loved it.. Subscribed!

  • @sitronco
    @sitronco 4 роки тому

    Great video. Thanks for the content

  • @yy-gf7ze
    @yy-gf7ze 3 роки тому

    You are always amazing AF.

  • @tjalferes
    @tjalferes 2 роки тому

    Thank you.

  • @ellisbrown3539
    @ellisbrown3539 3 роки тому

    Such a good video.

  • @happyl4463
    @happyl4463 3 роки тому +3

    I was totally distracted by your cat lol

    • @AlgosWithMichael
      @AlgosWithMichael  3 роки тому

      He wouldn't move when I was about to film, so he had to do it :p

  • @sumitvaise5452
    @sumitvaise5452 2 роки тому

    Simply and well put explanation. Thanks

  • @kevinchou1522
    @kevinchou1522 3 роки тому

    The hard part of this problem for me was the recognizing and implementing backtracking optimization... which turns out can be done easily with a count variable haha

  • @thebluefox100
    @thebluefox100 2 роки тому

    why is 1,6 a valid substring in your video at 7:28 ? it does not contain any 'A'

  • @shags91
    @shags91 2 роки тому

    This doesn't work if you have t containing multiple same characters. Even if t = "aabc", this algorithm still returns "banc"

  • @piratesuman
    @piratesuman 3 роки тому +1

    If the string T was "ABBC" shouldn't the count be 4? map.size() would be 3, right?

    • @AlgosWithMichael
      @AlgosWithMichael  3 роки тому +1

      The count is the number of unique characters, so in that example it would still be 3.

  • @3pleFly
    @3pleFly 2 роки тому

    I didn't like that the first window size you gave is incorrect, ADOBEC is not 5 length, but 6! , I understand what you're doing but it seems strange to me.

  • @bigE595
    @bigE595 3 роки тому

    For time complexity, you say N is length of string S and M is length of string T. For space complexity, you say N is length of string T. Was this a mistake? Why not keep the variable names consistent across time and space complexity? Thanks for the great video, enjoyed watching.

    • @AlgosWithMichael
      @AlgosWithMichael  3 роки тому

      Yea good point. I guess it is habit for me to N and M for time and space complexity explanations

  • @naliniprakash7738
    @naliniprakash7738 2 роки тому

    Coolest Explaination

  • @rohinbisht9668
    @rohinbisht9668 2 роки тому

    correction: min length is j - i + 1

  • @amazingsaavya6268
    @amazingsaavya6268 3 роки тому +1

    I have a question: do we have to face coding interview with experience level 18 years if someone is already working as architect. ? Which companies may do that?

  • @gunahawk6893
    @gunahawk6893 2 роки тому

    how come ur were not visible to me these day man , please when got time do dp problems

  • @amansoni0922
    @amansoni0922 3 роки тому

    There is a nested while(), why is that not accounting for n^2 complexity ? Can anyone pls help me with that !

    • @AlgosWithMichael
      @AlgosWithMichael  3 роки тому +1

      Yea I understand why that is confusing. The while loop is moving our 2nd pointer to in the worst case touch each element one time. So in other words in the worst case, each pointer will touch each node 1 time making the time complexity (n + n) which is just n. Hope that makes sense.

  • @____r72
    @____r72 2 роки тому

    Nice cat

  • @karthikVignesh-
    @karthikVignesh- Рік тому

    i just cant take my eyese off from that cat

  • @rohankumarshah5679
    @rohankumarshah5679 2 роки тому

    its not working fine in below test case
    s = "abc" ;
    t = "b" ;

  • @tusharsaini767
    @tusharsaini767 2 роки тому

    nyc code kitty

  • @kruthikasm2809
    @kruthikasm2809 2 роки тому

    This fails for case where s=aa and t=aa

  • @alpati123
    @alpati123 3 роки тому

    Its failing for the inputs as s = "aa" & t ="aa"

    • @shreyaprajapati969
      @shreyaprajapati969 3 роки тому +1

      needs to change on line 20:
      map.get(endChar) >= 0

    • @ruhigarga9542
      @ruhigarga9542 3 роки тому +2

      Instead of initializing count = map.size(); you need to initialize count = t.Length();

    • @gunahawk6893
      @gunahawk6893 2 роки тому

      @@ruhigarga9542 +1

  • @avinashsorab5026
    @avinashsorab5026 Рік тому

    Who's here from Daily Question 2/3/24? :)

  • @niranjan08538
    @niranjan08538 3 роки тому

    Quite confusing on updating minLength

  • @ramsescoraspe
    @ramsescoraspe Рік тому

    remove lyft from your list!! 😉

  • @meuko
    @meuko Місяць тому

    You sound like Todd Howard

  • @SonikaKumari-n7e
    @SonikaKumari-n7e 6 місяців тому

    Bruh u confused me a lot

  • @londrali8085
    @londrali8085 3 роки тому +1

    I wanna have 3 copies of that cat. I wanna swallow the first one like a pill, lick the second one for years to come, and just pet the third one for about 12 hours a day. Good explanation, too.

    • @AM-nv4ol
      @AM-nv4ol 2 роки тому +2

      i'm calling the police