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