Kotlinlearncs.online LogoJava
Return to List

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.

private boolean equalSubsets(int[] nums, int start, int total1, int total2) {
return false; // You may need to remove this starter code
}
boolean equalSubsets(int[] nums, int total) {
return equalSubsets(nums, 0, 0, 0);
}

Related Lessons

Stuck? You may find these lessons helpful: