Fix minimum coins for value test

This commit is contained in:
Dennis Eichhorn 2019-09-09 20:14:47 +02:00
parent 26383f1cde
commit af294ff9ac
2 changed files with 2 additions and 3 deletions

View File

@ -61,7 +61,6 @@ class MinimumCoinProblem
) {
$table[$i] = $subRes + 1;
$usedCoins[$i] = $coins[$j] === null ? ($usedCoins[$i] ?? []) : \array_merge($usedCoins[$i - $coins[$j]] ?? [], [$coins[$j]]);
$coins[$j] = null;
}
}
}

View File

@ -28,8 +28,8 @@ class MinimumCoinProblemTest extends \PHPUnit\Framework\TestCase
public function testMinimumCoins() : void
{
self::assertEquals(
[6, 6, 5],
MinimumCoinProblem::getMinimumCoinsForValueI([9, 6, 5, 6, 1], 17)
[],
\array_diff_key([6, 6, 5], MinimumCoinProblem::getMinimumCoinsForValueI([9, 6, 5, 6, 1], 17))
);
}
}