What is the error
hey @Par1hsharma
subset(arr, vidx + 1, sum + arr[vidx ], target); instead of subset(arr,vidx+1,sum+arr[vidx+1],target);
Output Format
Print the answer for each testcase in a new line.
If the sum of any of the subset is zero, then print “Yes” (without quotes) else print “No”(without quotes).
Work on it
how to avoid multiple “yes” and “no”
@Par1hsharma
Take fun return boolean
And In Main Function
if(subset(arr,0,0,0))
System.out.println(“Yes”);
else
System.out.println(“No”);
why there is stack overflow error and how to make this function boolean
@Par1hsharma
https://ide.codingblocks.com/s/306850 ( Stack overflow sahi hogya)
but, it’s always give true, try to correct this
try for this input :
1
4
1 3 2 6
Hints : take one parameter more ,It will monitor that it includes at least one element of the Array