Meeting Rooms II - LeetCode 253 Python

Поделиться
HTML-код
  • Опубликовано: 2 фев 2025

Комментарии • 45

  • @kairu86
    @kairu86 3 года назад +6

    After so many tutorials never explaining "why" we're comparing min end time to next start time, I FINALLY get it. Thank you!

    • @DEEPTITALESRA
      @DEEPTITALESRA  3 года назад

      AHH so glad to hear that!! Thanks sm Kyle!!:))

  • @immabe_kind
    @immabe_kind 2 года назад +1

    this is super!! love it - love the way you walk through the examples step by step!

  • @manishamanohar9852
    @manishamanohar9852 3 года назад +3

    I love your explanations! Especially when you walk through the code after you're done!

    • @DEEPTITALESRA
      @DEEPTITALESRA  3 года назад

      So glad to hear that!! Thank you so much Manisha!!!:))

  • @raunakthakur7004
    @raunakthakur7004 3 года назад +4

    Deepti among all the LC you tubers I like how you explain and walk us through an example. Also I use Python so i am so grateful to your videos.

    • @DEEPTITALESRA
      @DEEPTITALESRA  3 года назад

      Ahhh thank you so much Raunak!! Love to hear it!!:))

  • @jojo23srb
    @jojo23srb 2 года назад +1

    this was definitely the best most intuitive vid i could find on this problem. thank you!!

    • @DEEPTITALESRA
      @DEEPTITALESRA  2 года назад

      Aw thx so much - love to hear it!:))

  • @jasonliu3202
    @jasonliu3202 3 года назад

    Your explanation with an intuitive example makes your video super clear. Logic is clear and just save me a lot of time to understand this problem. However, there is one small mistake is that you don't need to keep the max heap deepth as you never pop without a push. I really appreciate your video. Thanks!

  • @PATRICKCHUAD
    @PATRICKCHUAD 3 года назад +2

    very clear explanation. Thanks for sharing !

  • @aldoushuxley8610
    @aldoushuxley8610 3 месяца назад +1

    thank you , the best explanation for this question❤

  • @soulmusic7664
    @soulmusic7664 3 года назад +2

    very interesting and nice explanation .thank you for explaining so clearly and loved the walkthrough..

  • @moorchini
    @moorchini 3 года назад +1

    Love your dark background 👍👍🥂

  • @kshitishsorte2918
    @kshitishsorte2918 3 года назад +1

    thank you so much. I implemented this in C after seeing your explaination.

  • @michaelsiu8353
    @michaelsiu8353 2 года назад +1

    Thanks - this explanation was great

  • @venkatasriharsha4227
    @venkatasriharsha4227 4 года назад +3

    Great explanation 🤩

  • @emmawu8137
    @emmawu8137 3 года назад

    Thank you so much for the amazing answer! I'm wondering if it is ok to remove lines 5 and 11, and just return len(heap), it works in leetcode but I just want to confirm with you😊

  • @rojo_pes75
    @rojo_pes75 3 месяца назад +1

    Yo bro🫡🐐amazing explanation

  • @samsonkolge3627
    @samsonkolge3627 4 года назад +1

    Enjoyed this one too.

  • @sanooosai
    @sanooosai Год назад +1

    great thank you

  • @chandrasekhar-kh7br
    @chandrasekhar-kh7br 2 года назад +1

    well explained

  • @lomnguyen8598
    @lomnguyen8598 2 года назад +1

    yayyyy

  • @rifatrahman4906
    @rifatrahman4906 4 года назад +3

    I just wanna say you are really so cuteeee!!

  • @divyatalesra4767
    @divyatalesra4767 4 года назад

    super helpful!!!!!

  • @Kuntalsh
    @Kuntalsh 4 года назад

    Found a way without heap. What do you think ?
    starttime = sorted(i[0] for i in numbers)
    endtime = sorted(i[1] for i in numbers)
    starp = 0
    endp = 0
    usedrooms = 0
    L = len(numbers)
    while starp < L:
    if starttime[starp] >= endtime[endp]:
    usedrooms-=1
    endp+=1
    else:
    usedrooms+=1
    starp+=1
    print(usedrooms)

    • @DEEPTITALESRA
      @DEEPTITALESRA  4 года назад +1

      Hey Kuntal! I think this is def an interesting approach! I'd recommend running it directly in leetcode to see the errors/debug. As it is right now, I believe it won't produce the right answer. Correct me if I'm wrong, but sorting separately for the start and end times breaks up the intervals, and we won't be able to see how many rooms would be needed. Are you simply trying to see overlap right now? Love that you are exploring alternative solutions though!!:)

    • @Kuntalsh
      @Kuntalsh 4 года назад

      @@DEEPTITALESRA thanks for the reply. I did try on leetcode and it got accepted. Yes, I just try to see the overlap and if not, not increasing the count.

    • @DEEPTITALESRA
      @DEEPTITALESRA  4 года назад +1

      @@Kuntalsh OOhh I see! That's also a nice solution that works in O(nlogn) and O(n) time and space!

  • @justdavid7107
    @justdavid7107 2 года назад +1

    damn she fine

  • @walidzein1
    @walidzein1 2 года назад

    WHY THE FUCK WE NEED A MIN HEAP

  • @TheSadhguruSense
    @TheSadhguruSense 4 года назад

    Dislike for low volume 😢

    • @DEEPTITALESRA
      @DEEPTITALESRA  4 года назад +3

      lol you can increase volume on RUclips on the bottom left of the bar - let me know if that helps!

    • @TheSadhguruSense
      @TheSadhguruSense 4 года назад

      @@DEEPTITALESRA no mam it doesn't 😞