That’s good. Thanks for the link.
Though the expression is same, we are here counting number of ways to get that.
Lets say we have {4 5} and {2a,2b,2c} where a,b,c just differentiate between 2’s. So m=2 and n=3.
Now we have three possibility {2a 4 5} {2b 4 5} {2c 4 5}
For first set, 2b have 3 places to be put i.e (m+1)
now we have {2a 2b 4 5} {2a 4 2b 5} {2a 4 5 2b}
So 2c have 4 places to be put i.e (m+2) for every above set possible after putting 2b. so just for 1st set we have
{2a 2c 2b 4 5}{2a 2b 2c 4 5}{2a 2b 4 2c 5}{2a 2b 4 5 2c}
You can see first two sequences are same(by removing a,b,c) but we will count them.
Oh, I see. Thanks, mate
Thanks for this good paper…
Is the loop "for (int r = k - 1; r >= 0; --r) " should be "for (int r = k ; r >= 0; --r) "?? Please explain it.