Notes/Codes/Problem links under day 8 of A2Z DSA Course: takeuforward.org/strivers-a2z... Follow us on our other social media handles: linktr.ee/takeuforward
Пікірлер: 96
@Noob_Coder12343 ай бұрын
REMEMBER IF STRIVER IS MAKING , THEN IT WILL BE THE BEST PLAYLIST ON BIT MANIPULATION
@modiji87063 ай бұрын
1. Swap two numbers - 00:00 2. Check if ith bit is set or not - 3:47 3. set ith Bit - 10:47 4. clear ith Bit - 14:27 5. Toggle ith Bit - 17:52 6.Remove the last set Bit - 21:23 7. Check if a number is power of 2 or not - 28:26 8.count the number of set bits - 31:24
@NAMAN-wj7dj2 ай бұрын
thanku modi ji ! abki baar 400 paar 👍
@modiji87062 ай бұрын
@@NAMAN-wj7dj Vote dena mt bhulna Abki baar Modi Sarkar
@02deepak2 ай бұрын
@@modiji8706 modi ji wo recession ka kuch hojata toh badhiya maan lgta voting m
@himanshutiwari66142 ай бұрын
@@02deepakmodiji khud pdh rhe hai dsa😅
@modiji87062 ай бұрын
RastraPati Bhawan ma A jao kl ispe wartalap krte hai
@SuvradipDasPhotographyOfficial23 сағат бұрын
Awesome Striver, done with sliding window and two pointers and now started with bit manipulation yesterday
@user-tk3td3nc4q3 ай бұрын
Never seen better teacher than u
@Benstokes5553 ай бұрын
YESS
@nguyengiahuy62923 ай бұрын
struggling so much with this topic alone. Thank you for the series!!!!
@knowthrvdo3 ай бұрын
Thanks for starting uploading again it is very helpful for us.
@bhushandharne88273 ай бұрын
Sir, Your Techniques are superb
@tamannaverma41783 ай бұрын
Thanks for all these efforts :)
@leaguesonu93543 ай бұрын
hats off man for your hardwork
@kbsceАй бұрын
Neatly, clearly explained which anyone can easily understand 😊really appreciated your efforts😊
@coderspathwayАй бұрын
I have paid DSA course from GFG. But not able to understand BIT manipulation. After watching this playlist by striver I feel the striver did it better than any other paid course in the market.
@yashwanthbm754324 күн бұрын
same here i paid for my gfg self paced but i'm now watching strivers youtube to solve DSA
@AdityaSharma-er3gs7 сағат бұрын
33:00 here you can simply do this public static int countSetBit(int num){ int count = 0; int one = 1; while(num > 0){ if((num & one) == 1){ count++; } num = num >> 1; } return count; }
@rahuljain2242 ай бұрын
Salute to your hardwork and explanation
@KaushalDhruw2 ай бұрын
before this I thought I knew bitwise operations. But the tricks you've shown are awesome. Thanks again.
@tgayush14247 күн бұрын
amazing video covering all concepts, soon will be mastering bit manipulations by completing your playlist.Before i used to be scared of seeing bits but now it's easy , even i started to use , today i used in one question and solved that question easily.
@Benstokes5553 ай бұрын
MY MAN IS BACKKKKKKKKKK
@stith_pragya2 ай бұрын
Understood....Thank You So Much for this wonderful video.........🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
@lakshmanlk9772 ай бұрын
Ohh striver such an amazing lecture ..
@veerverma55863 ай бұрын
Keep going 🏆
@user-nb6fx1rf9i3 ай бұрын
Many times I thought to comment on his post and lastly just leaving it by pressing like button.. thinking that kya kya bolega log,,! Is there anyone else like me ? Aisa koi h Banda Jo striver se bhi accha padhata ho ! I don't think so some one exist ❤
@pranavmittal96193 ай бұрын
ek h lekin me nahi batunga bas hint de deta hu : 2 crore ka package chod diya bande ne
@user-nb6fx1rf9i3 ай бұрын
@@pranavmittal9619Bhai hai to bata do jara hum bhi Jane kon h, teacher hi na , terrorist thode h Jo bata na paoge 😂 kahi tum hi to nahi ho wo 2 cr vala Banda Jo chhup chup ke bit manipulation ka maja le rahe ho😊
@QuantumcorekickАй бұрын
i dont know how to say thank you but you saved me striver . thank you>3000
@user-qb8vy2gy2w3 ай бұрын
Thanks for teaching every possibility answer for the problems❤❤❤
@tapasyadimree9651Ай бұрын
17:20 when finding ~(1
@GoluKumar-sb2siАй бұрын
same doubt bro
@AkOp-bf9vm28 күн бұрын
i think we cannot access 2's complement part and can only access negated part of the number maybe i am not sure
@ishwarreddy88203 ай бұрын
If striver is making then it will be the best playlist ;
@sakshikatiyar53533 ай бұрын
u are the best teacher
@anshrathore27313 ай бұрын
Thank you so much BHAIYA 🙏🙏🙏
@SumitKumar-qg4ps3 ай бұрын
to clear ith bit(0 indexed), we can just do N = n xor (1
@chickukoshti37413 ай бұрын
toggle
@AnushkaMishra83 ай бұрын
Yes , but it will work same as toggling if the bit is not set and we don't want that , if the bit will be 0 then also it will be changed to 1 if we do this.
@HaamroNotesАй бұрын
@@AnushkaMishra8 yeah bro
@riachoudhary__3 ай бұрын
Thank you for making this video
@user-vf5gi2fd8y2 ай бұрын
super amazing!!
@thaman7013 ай бұрын
Great sir.❤
@banothutharun2743Ай бұрын
simple superb sir
@user-or5oz1pk2xАй бұрын
Thanks a lot Bhaiya
@UECAshutoshKumar3 ай бұрын
Thank you sir 🙏
@vijeshsshetty3 ай бұрын
thank you sir ji
@KapilSharma564198 күн бұрын
there is a question on GFG : Count total set bits You are given a number N. Find the total count of set bits for all numbers from 1 to N(both inclusive). which shows TLE by all your methods can you please explain it .
@subee1283 ай бұрын
Thank you very much
@ryugagaming1953 ай бұрын
Sir plz make more videos on sliding window
@uditgarg65088 күн бұрын
for checking ith bit set just do right shift by ith and check the resukting num is odd. if it is , it is set. else , not ...
@ok-jg9jb2 ай бұрын
Thanks❤
@ReNaq3132 ай бұрын
39:00 -> repeatedly removing the rightmost set bits and taking the count of times we did this operation would give us the number of set bits in a number
@roshankumar28021 күн бұрын
One-Liner: 1) Swapping Two Numbers : Num1=(Num1^Num2); Num2=(Num1^Num2); Num1=(Num1^Num2); 2) Check If i’th bit is set or not: if((Num&(1
@Neo-mx2yfКүн бұрын
So in prev video, a method was taught to find ~x but it is a bit unclear. Let me try clear it up. Actually, ~x is just 1's complement of x, i.e., flip all bits. Eg: ~19 = ~(010011) = (101100) in binary = -20 in decimal Now we know (-x) is actually 2's complement of x. So what he taught is actually to find -x manually. Take prev eg, ~(010011) = (101100) in binary = -(2's complement of 101100) in decimal = -(010100) in decimal = -20 Take other way, ~(-20) = ~(101100)=010011 in binary=(directly) 19 Note: For easiness just assume that instead of 32 bits, there are only 6 bits here.
@chaitrabhat8199Ай бұрын
Understood
@ajayprabhu465Ай бұрын
Helpfull
@parvahuja76183 ай бұрын
thanks
@navinchaudhary28123 ай бұрын
understood
@saikrishna8723 ай бұрын
First one to see❤
@hakunamatata-nl4js17 күн бұрын
Gawd level
@sristikabora52629 күн бұрын
I got it :)
@rahulnagwanshi2348Ай бұрын
check if a number is a power of two -> !(N & 1)
@sachinvarma9949Ай бұрын
Bro loves 13 anyways best lecture on yt.
@nashalafroz3 ай бұрын
17:30 sir if we use not operator wouldnt the number converted into its 2's complement
@janarddansarkar26943 ай бұрын
same doubt. Someone please clearify
@janarddansarkar26943 ай бұрын
What I am assuming is since we are not storing the negative answer, so 2's complement is not used. If the answer was negative, then to store it, 2's complement would have been used. This is my assumption though. Not sure
@human02253 ай бұрын
Any solution to this I am still struggling with this.
@kumarnishantnitallahabad1602 ай бұрын
same doubt
@akshatchoudhary2783Ай бұрын
Bhaiya in the Clear bit Soluton can we use XOR operation? like below n = 13, i =2 13 -> 1101 1
@iamnoob7593Ай бұрын
SUPERR
@kingraj47972 ай бұрын
I think right and left shift operation or not required for finding the i th bit is set(1) or reset(0) for given binary digits Here I have code please verify it it is taking O(1) time complexity to find it.. // ith bit is set or reset import java.util.*; class SetOrReset{ public static void main(String args[]) { Scanner sc=new Scanner(System.in); String str=sc.next(); int i=1; int j=str.length()-1; int x=str.charAt(j-i)-'0'; if(x==1){ System.out.println("Set"); }else{ System.out.println("Reset"); } } }
@anupkhismatrao928018 күн бұрын
❤
@AmandeepSingh-rd6ql2 ай бұрын
Any reason for using left or right shift operator what is the intuition behind it anyone
@ifirdaus0_03 ай бұрын
can i use (n ^ (1
@aayushgupta78393 ай бұрын
yes you can , I have also done the same for the code ninja question and it cleared all the test cases.
@coder_072 ай бұрын
Yes , but it will work same as toggling if the bit is not set and we don't want that , if the bit will be 0 then also it will be changed to 1 if we do this.
@sagarray7073 ай бұрын
Mai first
@saqibaqeel91963 ай бұрын
Is this question available in leet code
@user-lx3hb7dt2w3 ай бұрын
when we need to count the total set bits from 1 to N , the following code gives TLE when N=10^9 because of the for loop. how can this be optimised ? int count(int n) { int cnt=0; while(n!=0) { if(n&1==1) cnt++; n=n>>1; } // if(n==1) cnt++; return cnt; } int countSetBits(int n) { //Write your code here int ans=0; if(n==1) return 1; for(int i=1;i