Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
My solution is 'wrong' in some cases for 1 number. I have been testing this solution and its right! Its seems that the problem lays on the rounding used on the tests.
function calculate_scrap($scraps, $robots): int {
$tot = $robots * 50; // total iron needed, not the brute.
foreach ($scraps as $perc) {
$tot = ($tot * 100) / (100 - $perc);
}
return round($tot);
}
Kata description should be made language agnostic
Working in python, it seems that the test has integers inside nested lists.
''' The content of a dictionary item is not correct: [42740748] should equal [[42740748]] '''
This is also causing a TypeError, can't compare 'list' to 'int'
Looking at the rules and examples, the result should be a list of ints, not a list of a list of ints.
Type error in description
The Description is inaccurate. It says values should be converted to a list if duplicate values from other dicts are present, but it actually requires that all values are converted to lists regardless of what the other dicts contain (or even if there are no other dicts to merge).
Duplicate of Queens and Kings Stable Marriages
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution