groupNoAdj

public boolean groupNoAdj(int start, int[] nums, int target) {
  
  if( start >= nums.length){
    return target==0;
  }


  if(groupNoAdj(start+2, nums, target-nums[start])) return true;
  if(groupNoAdj(start+1, nums, target)) return true;


  return false;
  
}

http://codingbat.com/prob/p169605

posted @ 2017-02-14 19:11  友哥  阅读(246)  评论(0编辑  收藏  举报