What will be the output of the following program?
public class AllTheBest {
public static void main(String[] str) {
boolean result;
int ary[] = {2, 4, 8};
result = groupSum(0, ary, 10);
System.out.print(result + ", ");
result = groupSum(0, ary, 9);
System.out.print(result + ", ");
result = groupSum(0, ary, 14);
System.out.println(result);
}
public static boolean groupSum(int start, int[] nums, int target) {
if (start >= nums.length)
return (target == 0);
if (groupSum(start + 1, nums, target - nums[start]))
return true;
if (groupSum(start + 1, nums, target))
return true;
return false;
}
}