No test case is getting passed

I have created the program for “subset sum easy” problem. It compile correctly and give expected output but when I submit it, all get fail.

Below is the code.

Regards,
Haard

Hello @haardpatel07,
You have shared your solution link pls share the problem/question link.

Below is the link of problem. Please do the needfull.

https://online.codingblocks.com/app/player/276028/content/265891/4760/code-challenge

Regards,
Haard

Hello @haardpatel07,
Why have you written the helper function. What you have done is created all the subsets of that array and for each subset that you created you check whether the sum of that subset is 0 or not. This is what you did?
This approach will take exponential time complexity which is high and your every test case will not pass.

Yes I am checking for each subset.

what can be the potential solution then ?

Hello @haardpatel07,
For this question I will get back to you as I feel something is incorrect with this question.
See the sample test case which is shared it is {3,-3} it is not a subset as for subset it should be continuous.

You can try solving the similar question from leetcode.

Thank You.

I beilieve there is problem in quesion.

Thanks for resolving it.

Regards
Haard

okk try solving the similar one.

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.