no message

This commit is contained in:
2025-05-02 15:26:34 +02:00
parent cfc3b5b7ca
commit 014c71d64c

View File

@@ -87,15 +87,25 @@ class Verbraucher_extern extends IPSModule
return array_values(array_unique($kombinationen));
}
private function findCombinationRecursive($power, $values, $currentCombination, $startIndex, &$result) {
if ($power == 0) {
$result = $currentCombination;
return true;
}
if ($power < 0) {
return false;
}
}
private
function findCombinationRecursive($power, $values, $currentCombination, $startIndex, &$result) {
if ($power == 0) {
$result = $currentCombination;
return true;
}
if ($power < 0) {
return false;
}
for ($i = $startIndex; $i < count($values); $i++) {
$currentCombination[] = $values[$i];
if (findCombinationRecursive($power - $values[$i], $values, $currentCombination, $i + 1, $result)) {
return true;
}
array_pop($currentCombination);
}
return false;
}
private function findCombination($power, $values) {
$result = [];