码迷,mamicode.com
首页 > 其他好文 > 详细

groupNoAdj

时间:2017-02-14 20:48:11      阅读:187      评论:0      收藏:0      [点我收藏+]

标签:art   public   boolean   logs   .com   false   targe   style   start   

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

groupNoAdj

标签:art   public   boolean   logs   .com   false   targe   style   start   

原文地址:http://www.cnblogs.com/youge-OneSQL/p/6398985.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!