Count Number of Maximum Bitwise-OR Subsets - Leetcode 2044 - Python

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

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

  • @abhimanyuambastha2595
    @abhimanyuambastha2595 7 дней назад +25

    37 minute video uploaded 8 minutes after the problem was revealed? Teach us your ways

  • @yashwantmoharil5892
    @yashwantmoharil5892 7 дней назад +12

    Bro has legit Brute Forced recording all LeetCode problems. This is the only possible explanation I have.
    Or you are some part of Higher Order leetCode group. If you are, don't forget to thank Beyonce

    • @NeetCodeIO
      @NeetCodeIO  7 дней назад +8

      I actually use a different heuristic, but with all these people thinking i'm some kind of leetcode time traveler.. i'm reluctant to tell them how i'm doing it lol

    • @siddharth-gandhi
      @siddharth-gandhi 7 дней назад +1

      @@NeetCodeIO Please tell, my curiosity is pipiqued

    • @NeetCodeIO
      @NeetCodeIO  7 дней назад +23

      The leetcode home page when you're signed in. Leetcode publishes editorials and you can see which ones were most recently added. Those are generally the daily LC questions.

    • @prajwals8203
      @prajwals8203 7 дней назад

      @@NeetCodeIO You can also go one step further by tracking the existing editorials which are recently removed, those ones are also gonna show up....but well I guess they are gonna publish new editorial in few days... so yeah tracking discuss is enough

  • @youneverknow7096
    @youneverknow7096 7 дней назад +22

    how did bro record 37 mins in like 7 mins since the problem's released 💀.
    okay...ig its pre recorded

  • @jamestwosheep
    @jamestwosheep 7 дней назад +1

    I just want to express my gratitude for your numerous and clear explanations on how to approach this problem. They are so much more helpful than the LC editorials, for sure.

  • @ignacioaguirre8137
    @ignacioaguirre8137 7 дней назад +2

    30:44 “I’m not even finna lie to you”. That gave me whiplash

  • @pewpewnowdie
    @pewpewnowdie 7 дней назад +2

    im kind of proud that i came up with the bit mask solution myself :)

  • @DoctorDuckload
    @DoctorDuckload 7 дней назад +1

    Mate thanks for these. Your structures made learning DSA so much easier. I sometimes get shocked how some questions that seemed impossible look so easy now.
    Can you possibly make a follow up for the video "Median of Data Stream"? When you made it it had no follow-ups, and it's kinda easy when you know the approach. But the follow ups now pose some interesting challenges. Would love to hear you thoughts.

  • @finemechanic
    @finemechanic 6 дней назад

    You can actually initialize defaultdict at construction by passing the initial dict as the second parameter.

  • @tejas1531
    @tejas1531 7 дней назад

    Amazing video! Your explanations are crystal clear and helped me grasp new concepts. The different approaches to solving the LeetCode problem were incredibly insightful. Keep creating!

  • @DNKF
    @DNKF 7 дней назад

    Thanks!Love this kind of multiple solutions to learn more!

  • @realisticlevel2553
    @realisticlevel2553 7 дней назад

    Divide and conquer boys and girls!
    First start by (recursively in my case) generating all possible subsets.
    Then once you have that you can concentrate on how to manage and compute the bitwise OR.
    I always do the problems on my own and then come back to the Neetcode vid to review and see if I missed something.
    Happy friday!

  • @jerryren4076
    @jerryren4076 7 дней назад +1

    The goat posts, I watch

  • @mmmeeelllmmmeeelll
    @mmmeeelllmmmeeelll 7 дней назад

    Keep up the good work

  • @aayushtheapple
    @aayushtheapple 7 дней назад

    I don't get the intuition of the better approach with simple recursion without memo in the given explanation at 13:30.
    Let's say we are counting the time complexity as n* maxOrValue but will there be a case to cover all the orValues between 0 -> maxOrValue ? no, right ? memoization is the same approach with pure recursion just it adds up one step to check if the index and orValue is present in the cache (previous computation) and right away gives the result early without further computation than how it's actually slower as compared to the vanilla recursion implementation ?
    Am I mistaken ? Appreciate if someone could help here.
    Btw, Thank you for this thorough explanation!

  • @DA5H
    @DA5H День назад

    Just a doubt. How in the caching approach did you come up with the fact that the time complexity is the same as space? Since we are adding caching to the first approach, if something repeats it will return immediately. What am i missing?

  • @faster-than-light-memes
    @faster-than-light-memes 7 дней назад

    Really cool!

  • @piglovesasy
    @piglovesasy 6 дней назад

    7:40 how come you're not pop()/backtrack if you do include i?

  • @ya_xiang1212
    @ya_xiang1212 7 дней назад

    I like the 4th way because I have not learn what dp is.

  • @ahmedtremo
    @ahmedtremo 7 дней назад

    thank you is the least I can say!

  • @rahulsihara8946
    @rahulsihara8946 7 дней назад

    so how did you know on 11th Oct that this will be a daily problem for 17 oct? 🤔🤔

  • @mohammed.a1002
    @mohammed.a1002 7 дней назад

    Hello 👋

  • @guyguysir3216
    @guyguysir3216 7 дней назад

    I feel like it's because different parts of this editorial is written by different authors...

  • @DeathSugar
    @DeathSugar 7 дней назад

    I wonder how tf recursive solutions leaks so much memory and deepcopying dict is not

  • @prajwals8203
    @prajwals8203 7 дней назад +1

    Lightning

    • @NeetCodeIO
      @NeetCodeIO  7 дней назад +8

      im fast af boiiii 🏃

  • @nofollowrobotstxt
    @nofollowrobotstxt 7 дней назад

    this is a nice vid tho hahahah, in a past life you and i would be great friends bc id lie and make up stories about hidden gems i discovered

  • @parthmaheshwari1899
    @parthmaheshwari1899 7 дней назад

    Hey there's a mistake, 10^5 = 100,000, not 10,000.
    So the further calculation are also wrong, n * max_or is not 160,000 but 1,600,000

    • @NeetCodeIO
      @NeetCodeIO  7 дней назад +1

      Good catch. I believe my point still stands that 65,000 < 1,600,000 and the first solution is more efficient

    • @aayushtheapple
      @aayushtheapple 7 дней назад

      Actually it should be 3200000 as
      max_or * n
      (2 * max_value) * n
      2 * 10^5 * 16
      = 3200000

  • @harshkumarchhabra2304
    @harshkumarchhabra2304 7 дней назад

    bro i live in india , can i buy your lifetime subscription of neetcode of 300 something $ ? and how

  • @SidhanthSanil
    @SidhanthSanil 7 дней назад

    Streakkkk bb

  • @nikhil199029
    @nikhil199029 7 дней назад

    But how do we know you arent a shape shifting AI brained alien though?

  • @greedyfishbones
    @greedyfishbones 6 дней назад

    this makes me feel so stupid

  • @UmahEdu
    @UmahEdu 7 дней назад

    Bro do you know Hindi just chill

  • @siddharth-gandhi
    @siddharth-gandhi 7 дней назад +1

    Bruh it’s been only 10 mins since daily launched, how you record 30min video 🤌