Error is coming in code.Pls edit code
Subset sum Easy Problem
@sulbh579
Two mistakes In your code
a) you are not returning when i==n ,add a return statement inside if (i==n)
b) there may be so many subset possible whose sum equal to zero so your code will print that many time yes or no .to remove this error use a boolean variable initialse it with false. then if any subset encounter with sum zero make boolean variable true.
at end check value of boolean variable if it is true print yes otherwise no
I edited my code but it is not still working
@sulbh579
hello sulbh ,
your code was almost correct.i have added some changes along with comments
please check it out and let me know if u still face any issue
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.