You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 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.
7
+
8
+
// Input Format
9
+
// The first line contains an integer T, which is the total number of test cases.
10
+
// T test cases follow.
11
+
// Each test case consists of two lines.
12
+
// The first line consists of a single integer N, which is the number of elements present in the set A.
13
+
// The second line contains N space separated integers denoting the elements of the set A.
14
+
15
+
// Constraints
16
+
// 1 ≤ T ≤10
17
+
// 1 ≤ N ≤ 4
18
+
// -10^5 ≤ A[i] ≤ 10^5
19
+
20
+
// Output Format
21
+
// Print the answer for each testcase in a new line.
22
+
// If the sum of any of the subset is zero, then print “Yes” (without quotes) else print “No”(without quotes).
0 commit comments