inn the dp solution table is filled wrong,u have always took dp[i-1][j-1] as the upper element and not upper diagonal one, U may check it out! very helpful video it was
sir you have computed the last row wrong plzz do check.....overall good video helped a lot very nicely explained specially the part which i was confused the most of how the s(n,k) formula came got cleared
dp[4][2]= 7 {the no. of times 2 sets can be made from 1,2,3,4} ie, {1, {2,3,4} }, {2, {1,3,4} }, {3,{1,2,4}}, {4, {1,2,3}}, {{1,2}, {3,4}}, {{1,3}, {2,4}}, {{1,4}, {2,3}} but u have writtern 5 . please clarify
Nice video. I wonder if there is direct formula that could calculate the answer without any need to construct the table? From the first glance, it looks like a variation of Pascal's triangle.
In DP solution , for second loop.. the termination condition should be j
yeah correct.... I was also thinking the same...thanks for pointing it out !!
inn the dp solution table is filled wrong,u have always took dp[i-1][j-1] as the upper element and not upper diagonal one, U may check it out! very helpful video it was
Yes. Same doubt thanks for clarifying.
Yes
last output it will be 6 but it will be 3*1+3=6 also dp[4][2] will be 2*3+1=7
yes exactly!
sir you have computed the last row wrong plzz do check.....overall good video helped a lot very nicely explained specially the part which i was confused the most of how the s(n,k) formula came got cleared
Thanks for pointing out.... I will check it out.
I think 3*3+1 =10 will be in last box as per sir explanations.
Not all heros wear cap.... Thanku sir. Continue with such great quality videos :).
Welcome :)
dp[4][2]= 7 {the no. of times 2 sets can be made from 1,2,3,4} ie, {1, {2,3,4} }, {2, {1,3,4} }, {3,{1,2,4}}, {4, {1,2,3}}, {{1,2}, {3,4}}, {{1,3}, {2,4}}, {{1,4}, {2,3}} but u have writtern 5 . please clarify
Very nice explanation. Thanks..Keep making such videos. Very easy to understand.
Welcome :)
Nice video. I wonder if there is direct formula that could calculate the answer without any need to construct the table? From the first glance, it looks like a variation of Pascal's triangle.
Interviewer won't be pleased even if a direct formula exists.
Wouldnt even nearly consider this as a good explanation...
so easy it becomes when u explain
Thanks :)
thanks much , really appreciate your effort
Thanks
Great recursive formula explanation!
:)
Thank u very much it was an amzing video
Welcome :)
thank you sir
Welcome
Thank you so much
Welcome :)
@@techdose4u any plans to prepare for PayPal coding
If n numbers will be same than what changes have to do
N-1CK . Think about it and let me know. I am almost certain about it, though not 100%.
@@techdose4u N-1 C K-1
The table is not filled according to the formula..plz check....there are also some calculation mistakes...
Video was helpful though
There is some mistake during filling table?
This is stirling numbers of the second kind.
Thanks TECH DOSE
Welcome
Can you tell how to print all such partitions, not just count the number of ways?
Save the partitions in array of list
The j in the solution should be up to k+1 not i+1 otherwise j will be out of the index.
if we are introducing nth element than it will generate k possibilities so why we are myltiplying k instead of adding it
Why can not i just juse nCk formula to find no. Of ways k elements can be selected using n elements.
Sir in last condition you said S(4,3)=2*3+1=7 but you said that is 6 ?
I must have said by mistake
Why not a combination?
==> C (n,k)
Why it is differ from combination.?
=>which case I am missing ?
I am very busy right now and i forgot this video as well 😅 please find something yourself for the time being.
is no of ways is n C k ?
what if all numbers in the array are the same ?
N-1CK . Think about it and let me know. I am almost certain about it, though not 100%.
this is wrong
thank you so much