Just a doubt won't there be a case where we are using 1! and 2^0 at same time....so we used the value 1 2 times which breaks the condition of distinct numbers
right...nice thought but aisa kabhi nhi hoga bcoz agar n odd hai and you are considering 1! then after removal number even hojaaega bcoz baaki sab factorial even hota hai (odd-odd=even) now even number mai you cant take 2^0 and vice versa..
@@BroCoders but if n is even and we use 1! so the resulting value i.e (n-factorial_sum) will also be odd...so expressing odd value as sum of power of two will force us to use 2power0 = 1 again...so we will be using 1 two times right
which question were you referring to in leetcode related to bitmasking?
ruclips.net/video/tk5rwYgBWZc/видео.html
ruclips.net/video/1_yfE1YQeQE/видео.html
Very nice explanation sir, Thank you!
Most welcome!
Nice explanation...with this i also get idea of bit masking...thank you!
Welcome 😊
mene vi first method se try kia tha ki max contribution ko hi shrif lunga but i got wa in tastcase 2
by the way nice explation bhiaya
Yeah that's why we mentioned it so you know why it won't work.
Same mai bhi
Thank u bhaiya
Welcome bhai!!
very well Explained...🔥
Glad you liked it!
Good explaination. Thanks.
Glad you liked it
Just a doubt won't there be a case where we are using 1! and 2^0 at same time....so we used the value 1 2 times which breaks the condition of distinct numbers
right...nice thought but aisa kabhi nhi hoga bcoz agar n odd hai and you are considering 1! then after removal number even hojaaega bcoz baaki sab factorial even hota hai (odd-odd=even) now even number mai you cant take 2^0 and vice versa..
@@BroCoders but if n is even and we use 1! so the resulting value i.e (n-factorial_sum) will also be odd...so expressing odd value as sum of power of two will force us to use 2power0 = 1 again...so we will be using 1 two times right
@@arpandesai2034 but that wont be minimum right?
biult-in popcount (n-sum) aslo got accepted
Great!!
@SG can u send your accepted code
Awesome implementation..
Glad you liked it
Nicely explained
Thank you so much 🙂
Nice explanation 👏
Thanks
Thanks
Welcome!!!
for (int i = 1; i < 14; i++) fact[i] = (i + 1) * fact[i - 1]; factorial nikalte time i*fact[i-1] ku ni kiya?
Bcoz mai 0 based indexing liya hun😊
Still agr hmm fact[0]=1 kiye h then 1 se iterate krege toh i* fact[i-1] toh shi calculate krega na toh i+1 ku use kiye h?
0 mai 1 ka factorial stored hai toh 1 mai 2 ka factorial store hogana
@@BroCoders okie smhj gya logic 👨💻 thank you😊
Aisa content kaha se laate ho bhaiya???❤️🔥❤️
Dil se :)))
@@BroCoders ufff🔥❤️
why did you kept the first loop from 0 to 1
Basically I iterated over all the masks possible which I explained 5 mins before , will recommend to watch the last 10 mins again.
@@BroCoders thanks for quick response
ram ram bhaiyaa ❣️
Jai shree radhe krishna ❣️
hare Krishna❣️
@@cokewithcode Radhe Radhe!!
Can you please work on your audio.
Yes, we have to .... actually the mic is a bit hasy and (the speaker even spoke a bit faster). We'll take care next time..........