How to check condition when sum is 0.please correct my logic

approach this problem as subset sum problem…in which you are given a target sum as 0…every element has two options either it can be a part of the subset or it cant be a part of the subset…in the base case you can check whether the sum is equal to 0…if it is equal to 0 then you can update a global boolean variable…in main after the execution of your subset function you can check the value of that boolean variable and print the ans accordingly…

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.