201. Bitwise AND of Numbers Range | Remove Last Set Bit | Bit Manipulation

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

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

  • @rajrajesh1669
    @rajrajesh1669 8 месяцев назад +4

    1:20 😂 bro that cracked me up...

  • @Sakshi-yq4jm
    @Sakshi-yq4jm 7 месяцев назад +1

    this was literally the best explanation, i have been trying to understand the reason behind this approach for quite some time now, been surfing youtube all day today. and finally. good work. thank you!

    • @ARYANMITTAL
      @ARYANMITTAL  7 месяцев назад

      Glad it was helpful Sakshi 🙇🫡🫂

  • @tusharkumarraj6066
    @tusharkumarraj6066 Месяц назад

    loved the explanation. Watched explanation video from neetcode and didnt understand much , this one was so simple and intiutive

  • @aayushyavajpayee4989
    @aayushyavajpayee4989 5 месяцев назад

    from 8:16 to 8:48, you can avoid that and video will become shorter and crisp. You are doing great

  • @akhilkarumanchi458
    @akhilkarumanchi458 8 месяцев назад +9

    Can you make a video of your day time table ?

  • @sameershah1492
    @sameershah1492 8 месяцев назад +1

    Amazing approach ❤

  • @ganeshsharma5810
    @ganeshsharma5810 8 месяцев назад

    amazing approach bhaiya

  • @abhinavdubey_7
    @abhinavdubey_7 8 месяцев назад

    Thankyou my brother amazing.

  • @alifrahman7099
    @alifrahman7099 8 месяцев назад

    thanks

  • @ritishrai581
    @ritishrai581 8 месяцев назад

    Oh f . I did this using the BIT MANIP trick you taught in one of your previous videos . I guess the tc would still be equal to the no of bits right?
    #define ll long long
    class Solution {
    public:
    void calcBitRange(vector&bits, int num) {
    if (num==0) {
    return ;
    }
    if (num==1) {
    bits[0]++ ;
    return;
    }
    else if (num==2) {
    bits[0]++;
    bits[1]++ ;
    return ;
    }
    ll bitLen = log2(num);
    ll nearPowerOf2 = 1ll =0 ;i --) {
    bits[i]+= nearPowerOf2 >> 1ll ;
    }
    calcBitRange(bits,num-nearPowerOf2);
    return ;
    }
    int rangeBitwiseAnd(int left, int right) {
    vectorrange1(65,0) ;
    vectorrange2(65,0) ;
    if (left==0) return 0 ;
    if (left>1) calcBitRange(range1,left-1);
    calcBitRange(range2,right);
    ll ans = 0 ;
    for (int i =0 ; i

  • @learningmaths786
    @learningmaths786 8 месяцев назад +1

    Thanks Aryan ❤

  • @shalinijha7359
    @shalinijha7359 8 месяцев назад

    just thankyou for existinggg

  • @codedecode8686
    @codedecode8686 8 месяцев назад

    nice approach

  • @HarshSharma-hi9vc
    @HarshSharma-hi9vc 8 месяцев назад

    nice explanation

  • @CodeMode9313
    @CodeMode9313 8 месяцев назад

    badia

  • @whoshyam
    @whoshyam 3 месяца назад

    please provide your onenote page
    link

  • @parthbhatti4151
    @parthbhatti4151 8 месяцев назад

    why chatgpt says O(log(right)) time complextiy ?

    • @sahilkarwani9629
      @sahilkarwani9629 8 месяцев назад

      if u take the maximum value of right according to question then it will be 2^32 then O(log(2^32)) gives you O(32) which is O(1).

    • @RachitKumar-yp2ub
      @RachitKumar-yp2ub 8 месяцев назад

      worst case time complexity is O(32). cause at max we might end up taking 32 traversals.