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.
Python translation: https://www.codewars.com/kumite/647dede6fdf80bbaded8558e?sel=647dede6fdf80bbaded8558e
When there are multiple solution, which one return?
(spoiler: 2)
The orange area represents areas where air could catch flame if the gray and orange areas are not clear of flammable blocks (for example, wood blocks).
Does it means the wood can not in both area?
Or wood can in gray area, and orange area would change depend on gray area?
So we can easily get what we are testing for, rather than print it out.
Trivial map/filter/reduce is not a novel kata idea at this point.
Ruby 3.0 should be enabled, check details here and here.
This comment is hidden because it contains spoiler information about the solution
Python translation kumited. Please review and approve.
Note: kata author is inactive
When reading the exercise i was confused about the goal. I got the impression the goal was to have the minimum number of items that add exactly to the fuel needed, then i realized it was far more simple and it was only a matter of adding the largest that fitted until getting the final value.
If there was a cost associated to each item (the largest would have the least cost per unit) the problem could be re-phrased and less dubious.
Good Kata, simpler than i expected.
JS:
A case of number like
4,444,444
(without a dot, meaning 4 mil) and number4,4
(meaning 4.40) should be added to fixed tests, because they change how numbers should be handled and are only encountered in one or 2 random tests. (nothing mentioned in description either)Also it would be helpful if description mentioned padding not only decimal places to 2 digits, but also hundreds to 3 digits, if neccessary.
Lastly some more edge cases could be added, say sum of
4,000,000.00
.Typescript translation and Julia translation
This comment is hidden because it contains spoiler information about the solution