0) { // echo "$target"." "."{$nums[0]}".PHP_EOL; // flush(); // } if($full < $rest) { return false; } if(array_sum($nums) < $target) { return false; } if(count($nums) == 0) { return false; } else if($nums[0] == $target) { return true; } else if($target < $nums[0]) { return false; } else { if(getCombination($target-$nums[0], array_slice($nums,1), $full, $rest)) { return true; } } $rest += $nums[0]; return getCombination($target, array_slice($nums, 1), $full, $rest); }