split array
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
MySQL限时解答,24小时内友哥专业解答
http://www.yougemysqldba.com
如有进一步需要请联系微信onesoft007
微博账号@友哥一指
http://www.yougemysqldba.com
如有进一步需要请联系微信onesoft007
微博账号@友哥一指