public boolean splitArray(int[] nums) { return dividSameSumGroup(0,nums, 0,0); } public boolean dividSameSumGroup(int start , int nums[], int sumA, int sumB){ if( start >= nums.length ){ if(sumA == sumB) return true; return false; } if(dividSameSumGroup(start+1, nums, sumA+nums[start], sumB )) return true; if(dividSameSumGroup(start+1, nums, sumA, sumB+nums[start] )) return true; return false; }
http://codingbat.com/prob/p185204