Here's my code:
public class JavaApplication16 {
public static void main(String[] args) {
//illegal start of expression, ']' expected, <identifier> expected
boolean a = groupSum(0, [2,4,8], 10);
}
public 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;
}
}
I've tried to look for ways to fix this, but I am just so lost. Please help me debug my code.