Doubt in Subset Sum Easy

The two test cases are not being passed, while the code is running fine.
Question
SUBSET SUM EASY
Mike is a very passionate about sets. Lately, he is busy solving one of the problems on sets. He has to find whether if the sum of any of the non-empty subsets of the set A is zero.

Input Format:
The first line contains an integer T, which is the total number of test cases. T

test cases follow.

Each test case consists of two lines.

The first line consists of a single integer N, which is the number of elements

present in the set A.

The second line contains the integer in the set.

Constraints:
1 ≤ T ≤10
1 ≤ N ≤ 4
-10^5 ≤ A[i] ≤ 10^5

Output Format:
If the sum of any of the subset is zero, then print “Yes” (without

quotes) else print “No”(without quotes).

Sample Input:
1
4
1 2 3 -3
Sample Output:
Yes
Explanation:
The sum of the subset {3,-3} is zero.
Code

Hello @ratulhans,

There are three issues with your code:

  1. The inner loop should iterate from j=i to n-1.

  2. Make sum=0 before third loop.

  3. Your output format is wrong.
    The output of each test case should be on a separate line.

I have modified your code:

Hope, this would help.
Give a like, if you are satisfied.

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.