i could not understand the line 18 of the code although i have modified it …
but i think it should be
sumitup(arr,n,t,i+1,0,out);
out={0}
}
but it’s not working can you please explain
Sum it up problem
Hi,
Suppose the case : 1 , 2 , 3. In this case at first we take all numbers 1 2 and 3. Then only 1 2 and then 1 3 then 2 3 we cannot make j=0, because if j is at 1 we can access 2 and 3. there is no need to make array out =0 during backtracking because j overites the element in the array out.