Subset sum =0 present yes or no

what is the error in code

giving segmentation fault ???

@hg11110000 hey can you explain your logic of finding subset sum = 0?

@himanshu_aswal
made each subsets via recursion and as soon as we find a subset i calculated the sum

@hg11110000 updated your code

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.

hello @hg11110000

u have reopened ur doubt , what issue u r facing now?

he didn’t told whats the fault in my code althought it seems correct

@aman212yadav

and he gave a new solutiion

in ur base case put return outside for (to avoid infinite recusion).

also intitalise p=0 inside while(t–) loop

check now->