You are viewing a single comment's thread. Return to all comments →
If Array A = {2, 1 ,2} and k represent sum of product of all unique k elements combinations.
for k = 1, sum = 2 + 1 + 2
for k = 2, sum = 2(1 + 2) + (1 * 2)
for k = 3, sum = 2 * (1 * 2)
Hope you have seen a general sequence here and those loops are actually reducing array to this general sequence :)
Seems like cookies are disabled on this browser, please enable them to open this website
Kundu and Tree
You are viewing a single comment's thread. Return to all comments →
If Array A = {2, 1 ,2} and k represent sum of product of all unique k elements combinations.
for k = 1, sum = 2 + 1 + 2
for k = 2, sum = 2(1 + 2) + (1 * 2)
for k = 3, sum = 2 * (1 * 2)
Hope you have seen a general sequence here and those loops are actually reducing array to this general sequence :)