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

  Рет қаралды 3,755

Aryan Mittal

Aryan Mittal

Күн бұрын

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/ary...
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

Пікірлер: 32
@user-hv7yx3ps5z
@user-hv7yx3ps5z 5 ай бұрын
The way you explain ideas is like watching a Bollywood movie; it's very engaging.
@Noob_Coder1234
@Noob_Coder1234 5 ай бұрын
best youtuber for leetcode , clean explainations with most optimzied codes !! god bless u bro!!
@shivamgurjar8979
@shivamgurjar8979 4 ай бұрын
so well explained
@rajan-u6b
@rajan-u6b 3 ай бұрын
love u sir, nice explanation.
@InWonderland-z2l
@InWonderland-z2l 2 ай бұрын
now i've watched your videos to the point that i hit like as soon as the video starts and then start watching it😂same as what i do with striver because i KNOW it's going to be epic🌟
@mukulkhanna5071
@mukulkhanna5071 4 ай бұрын
best video on entire earth
@slayer8792
@slayer8792 5 ай бұрын
This is a great solution , very nicely explained
@rishavsaha5254
@rishavsaha5254 5 ай бұрын
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 5 ай бұрын
Thanks for getting me a TLE ! Not optimal though
@kashishchawla2754
@kashishchawla2754 5 ай бұрын
@@akshatsingh6036 it wont bro!
@divyanshagrawal6267
@divyanshagrawal6267 5 ай бұрын
Cool Solution Dude :)
@aafighters4535
@aafighters4535 5 ай бұрын
Keep going bro.
@psk9736
@psk9736 5 ай бұрын
When setting xbit[i] and nbit[i] I used xbit[i] = x & (1 i) & 1 (n >> i) & 1
@ARYANMITTAL
@ARYANMITTAL 5 ай бұрын
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 5 ай бұрын
​@@ARYANMITTALoh accha 😅😅 understood thankyou ❤❤
@Danish-saifi1
@Danish-saifi1 5 ай бұрын
@@ARYANMITTAL int se & krne pr int me convert ho jata hai no? or 1 se krne pr binary me rehta hai?
@ayushtandon1719
@ayushtandon1719 5 ай бұрын
You can also do this xbit[i]=x&1; x>>=1; nbit[i]=n&1; n>>=1;
@lavanya_m01
@lavanya_m01 5 ай бұрын
Awesome explanation bro!! Can you pls solve 3134 also?
@prathamsharma4416
@prathamsharma4416 5 ай бұрын
nice 1
@AdityaYadav-qf9qc
@AdityaYadav-qf9qc 5 ай бұрын
@aryanmittal can we apply binary search on answer on this question??
@hrishavraj7706
@hrishavraj7706 5 ай бұрын
👌
@ias5462
@ias5462 5 ай бұрын
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
@bhushanasutkar6135
@bhushanasutkar6135 5 ай бұрын
Thanks
@mrityunjoybarman9098
@mrityunjoybarman9098 5 ай бұрын
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
@RitikRanjan-fn9me
@RitikRanjan-fn9me 5 ай бұрын
Intuition ban gya tha , but implement ni hua :/
@dhruvrawatt9
@dhruvrawatt9 5 ай бұрын
I give up on coding
@ayushmishra1207
@ayushmishra1207 4 ай бұрын
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
@242deepak
@242deepak 5 ай бұрын
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
@pranjalverma8239 5 ай бұрын
bhai kuch samaj nhi aaya 😢
@jimit2795
@jimit2795 5 ай бұрын
Sahi me. Sab upar se gya.
@panapatre9855
@panapatre9855 5 ай бұрын
while(until don't get it) { repeat_the_video() }
@Anonymous____________A721
@Anonymous____________A721 5 ай бұрын
Uff​@@panapatre9855
3128. Right Triangles | Math | Array | Biweekly Contest 129
12:44
Aryan Mittal
Рет қаралды 1,5 М.
Зу-зу Күлпаш 2. Бригадир.
43:03
ASTANATV Movie
Рет қаралды 729 М.
إخفاء الطعام سرًا تحت الطاولة للتناول لاحقًا 😏🍽️
00:28
حرف إبداعية للمنزل في 5 دقائق
Рет қаралды 77 МЛН
Who’s the Real Dad Doll Squid? Can You Guess in 60 Seconds? | Roblox 3D
00:34
Seja Gentil com os Pequenos Animais 😿
00:20
Los Wagners
Рет қаралды 23 МЛН
3085. Minimum Deletions to Make String K-Special | DP | Hash Table
16:14
Зу-зу Күлпаш 2. Бригадир.
43:03
ASTANATV Movie
Рет қаралды 729 М.