3133. Minimum Array End | Bit Interweaving | Bit Interleaving | Bit Manipulation | 2 Pointers

In this video, I'll talk about how to solve Leetcode 3133. Minimum Array End | Bit Interweaving | Bit Interleaving | Bit Manipulation | 2 Pointers
Let's Connect:
📱Discord (Join Community) : / discord
📝Linkedin: / aryan-mittal-0077
📸 Instagram: / ez.pz.dsa
💻 Twitter - / aryan_mittal007
🤖 Github: github.com/aryan-0077
About Me:
I am Aryan Mittal - A Software Engineer in Goldman Sachs, Speaker, Creator & Educator. During my free time, I create programming education content on this channel & also how to use that to grow :)
✨ Hashtags ✨
#programming #Interviews #leetcode #faang #maang #datastructures #algorithms

Пікірлер: 31

  • @user-hv7yx3ps5z
    @user-hv7yx3ps5z2 ай бұрын

    The way you explain ideas is like watching a Bollywood movie; it's very engaging.

  • @Noob_Coder1234
    @Noob_Coder12342 ай бұрын

    best youtuber for leetcode , clean explainations with most optimzied codes !! god bless u bro!!

  • @divyanshagrawal6267
    @divyanshagrawal62672 ай бұрын

    Cool Solution Dude :)

  • @rajan-u6b
    @rajan-u6b3 күн бұрын

    love u sir, nice explanation.

  • @mukulkhanna5071
    @mukulkhanna5071Ай бұрын

    best video on entire earth

  • @shivamgurjar8979
    @shivamgurjar8979Ай бұрын

    so well explained

  • @slayer8792
    @slayer87922 ай бұрын

    This is a great solution , very nicely explained

  • @aafighters4535
    @aafighters45352 ай бұрын

    Keep going bro.

  • @rishavsaha5254
    @rishavsaha52542 ай бұрын

    Thank you so much for the video. There can be a easy solution for this as well: Increasing the unset bits: long long minEnd(int n, int x) { long long a = x; n--; while(n--) { a=(a+1)|x; } return a; }

  • @akshatsingh6036

    @akshatsingh6036

    2 ай бұрын

    Thanks for getting me a TLE ! Not optimal though

  • @kashishchawla2754

    @kashishchawla2754

    Ай бұрын

    @@akshatsingh6036 it wont bro!

  • @bhushanasutkar6135
    @bhushanasutkar61352 ай бұрын

    Thanks

  • @prathamsharma4416
    @prathamsharma44162 ай бұрын

    nice 1

  • @lavanyam3224
    @lavanyam32242 ай бұрын

    Awesome explanation bro!! Can you pls solve 3134 also?

  • @hrishavraj7706
    @hrishavraj77062 ай бұрын

    👌

  • @AdityaYadav-qf9qc
    @AdityaYadav-qf9qc2 ай бұрын

    @aryanmittal can we apply binary search on answer on this question??

  • @ias5462
    @ias54622 ай бұрын

    I understood the logic..but i didn't get the intuition why n-1 number only we have to do the 2 pointer thing..like is there any concept behind

  • @psk9736
    @psk97362 ай бұрын

    When setting xbit[i] and nbit[i] I used xbit[i] = x & (1 i) & 1 (n >> i) & 1

  • @ARYANMITTAL

    @ARYANMITTAL

    2 ай бұрын

    Let us say you want to know existence of 2nd bit i.e for a number 4, which has binary representation as 100, then your code will say xbit[2] = 4 while, you wanted to know just that if that 2nd bit was set or not, which means you wanted xbit[2] = 1, xbit will have only 2 values 0 or 1, saying if some bit was set or not

  • @psk9736

    @psk9736

    2 ай бұрын

    ​@@ARYANMITTALoh accha 😅😅 understood thankyou ❤❤

  • @danishsaifdtu9203

    @danishsaifdtu9203

    2 ай бұрын

    @@ARYANMITTAL int se & krne pr int me convert ho jata hai no? or 1 se krne pr binary me rehta hai?

  • @ayushtandon1719

    @ayushtandon1719

    2 ай бұрын

    You can also do this xbit[i]=x&1; x>>=1; nbit[i]=n&1; n>>=1;

  • @dhruvrawatt9
    @dhruvrawatt92 ай бұрын

    I give up on coding

  • @mrityunjoybarman9098
    @mrityunjoybarman90982 ай бұрын

    Why my code is giving me wrong ans for 56 testcases ? public long minEnd(int n, int x) { int j = 0; long ans = (long)x; for(int i=0; i> i) & 1); if(bit == 1) continue; if((1 n-1) break; int newBit = (((n-1) >> j) & 1); j++; if(newBit == 0) continue; ans |= (newBit

  • @ayushmishra1207
    @ayushmishra1207Ай бұрын

    nBit[i] should be equal to ((n-1)>>1)&1 na instead of (n>>1)&1 as You have taught the same thing at 12:39

  • @RitikRanjan-fn9me
    @RitikRanjan-fn9me2 ай бұрын

    Intuition ban gya tha , but implement ni hua :/

  • @242deepak
    @242deepak2 ай бұрын

    Easiest code: class Solution { public: long long minEnd(int n, int x) { long long ans=x; long long k=n-1; for(int i=0;i

  • @pranjalverma8239
    @pranjalverma82392 ай бұрын

    bhai kuch samaj nhi aaya 😢

  • @jimit2795

    @jimit2795

    2 ай бұрын

    Sahi me. Sab upar se gya.

  • @panapatre9855

    @panapatre9855

    2 ай бұрын

    while(until don't get it) { repeat_the_video() }

  • @Anonymous____________A721

    @Anonymous____________A721

    2 ай бұрын

    Uff​@@panapatre9855

Келесі