3082. Find the Sum of the Power of All Subsequences | 0-1 knapsack DP | Binary Exponentiation

  Рет қаралды 2,604

Aryan Mittal

Aryan Mittal

Күн бұрын

Пікірлер: 15
@nikhilbabar2226
@nikhilbabar2226 8 ай бұрын
Great solution, got to know how different intutions get to same solution I thought in this way which might seem easier to understand: Consider a single element from array. There are 3 possibilities for it: 1) The element is present in your current array (considered subsequence) and you take it. 2) The element is present in your current array (considered subsequence) and you dont take it. 2) The element is not present in your current array (considered subsequence) If you see 2 and 3, they are same. So dontpick contributes twice. Hence, dp[i][k] = pick + 2*dontpick
@joshthwu
@joshthwu 8 ай бұрын
Great explanation! I spent about an hour and a half after the contest but still couldn't understand why we had to multiply by 2 when we chose not to take the number. However, I suddenly understood it during your explanation. Thanks a lot!
@xyz956
@xyz956 8 ай бұрын
bro just , you related with the knapsack problem, and built on that, that was super awesome bro , thanks.
@for_the_creators289
@for_the_creators289 8 ай бұрын
my god i just did this que and burh posted it u r very great >>>>>>> fr the best no words , good luckkkkkkk
@PrinceTiwari-md7of
@PrinceTiwari-md7of 8 ай бұрын
very nice explanation😃
@avijitdey992
@avijitdey992 8 ай бұрын
thanks a lot brother
@nishantkumarjha4644
@nishantkumarjha4644 8 ай бұрын
thanks bro..really helped
@IK-xk7ex
@IK-xk7ex 8 ай бұрын
Subsequence keeps the order, subset - no order required
@shashankvashishtha4454
@shashankvashishtha4454 8 ай бұрын
subsequence and subset are same, but the difference is that subset contain unique elements.
@adityajhunjhunwala9739
@adityajhunjhunwala9739 8 ай бұрын
in subsequence order of elements matter whereas in subsets order of elements doesnt matter
@asthajain2511
@asthajain2511 8 ай бұрын
😇
@akb3689
@akb3689 8 ай бұрын
🔝
@shashankvashishtha4454
@shashankvashishtha4454 8 ай бұрын
2^n
@venkateshaprabhup007
@venkateshaprabhup007 8 ай бұрын
Thanks for the great explanation bro 🫂
If people acted like cats 🙀😹 LeoNata family #shorts
00:22
LeoNata Family
Рет қаралды 30 МЛН
Do you love Blackpink?🖤🩷
00:23
Karina
Рет қаралды 23 МЛН
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 9 МЛН
2 Years of C++ Programming
8:20
Zyger
Рет қаралды 7 М.
My 2 Year Journey of Learning C, in 9 minutes
8:42
VoxelRifts
Рет қаралды 656 М.
Find the Winner of the Circular Game - Leetcode 1823 - Python
18:11