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
The way you explain ideas is like watching a Bollywood movie; it's very engaging.
best youtuber for leetcode , clean explainations with most optimzied codes !! god bless u bro!!
Cool Solution Dude :)
love u sir, nice explanation.
best video on entire earth
so well explained
This is a great solution , very nicely explained
Keep going bro.
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
2 ай бұрын
Thanks for getting me a TLE ! Not optimal though
@kashishchawla2754
Ай бұрын
@@akshatsingh6036 it wont bro!
Thanks
nice 1
Awesome explanation bro!! Can you pls solve 3134 also?
👌
@aryanmittal can we apply binary search on answer on this question??
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
When setting xbit[i] and nbit[i] I used xbit[i] = x & (1 i) & 1 (n >> i) & 1
@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
2 ай бұрын
@@ARYANMITTALoh accha 😅😅 understood thankyou ❤❤
@danishsaifdtu9203
2 ай бұрын
@@ARYANMITTAL int se & krne pr int me convert ho jata hai no? or 1 se krne pr binary me rehta hai?
@ayushtandon1719
2 ай бұрын
You can also do this xbit[i]=x&1; x>>=1; nbit[i]=n&1; n>>=1;
I give up on coding
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
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
Intuition ban gya tha , but implement ni hua :/
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
bhai kuch samaj nhi aaya 😢
@jimit2795
2 ай бұрын
Sahi me. Sab upar se gya.
@panapatre9855
2 ай бұрын
while(until don't get it) { repeat_the_video() }
@Anonymous____________A721
2 ай бұрын
Uff@@panapatre9855