Combinations with repetitions: Difference between revisions

Content added Content deleted
Line 871: Line 871:
}
}
$head = $arr[0];
if (count($arr) == 0) {
return array();
if (count($arr) == 1) {
$result = array();
for ($i = 0; $i < $k; $i += 1) {
array_push($result, $head);
}
return array($result);
}
}
$head = $arr[0];
$combos = array();
$combos = array();