789. Partition Equal Subset Sum
0
Medium
Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal.
Input Format
Input number of test cases T
Input N
Input A[i]
Input N
Input A[i]
Output Format
Print true/false accordingly for the array in each case.
Example
Input
1
4
1 5 11 5
Output
true
Constraints
1<=T<=100
1<=N<=100
1<=A[i]<=100
1<=N<=100
1<=A[i]<=100
Loading...
View Submissions
Console