Solve: Equal Subsets
Created By: Chris Taylor
/ Version: 2023.7.0
Write the recursive method, equalSubsets(int[] nums, int start, int total1, int total2),
that, when called by the provided equalSubsets(int[] nums) method,
returns true if it is possible to partition the values in nums into two
subgroups whose sum of values are equal.
You may assume that nums is not null.
For this problem we're expecting only a method.Don't define a class, include modifiers like static or public, add import statements, or add code outside the method declaration.
private boolean equalSubsets(int[] nums, int start, int total1, int total2) {
return false;
}
boolean equalSubsets(int[] nums, int total) {
return equalSubsets(nums, 0, 0, 0);
}