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.
The sample test currently checks against
243.33000000000001d
, not243.33m
.Fixed typo, thx.
Small spelling fix: at the second line, fix "buting" to "buying".
Also, not an issue per se, but I think it'll be good to add using System and/or using System.Linq to the initial code.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I think you misunderstood the rules:
Please note:
cheapest item for free
.The most expensive is not free, the supermarket is not charity ;-)
I feel like I am missing something. The kata states calculate discount so it works out best for customer (meaning biggest discount). This would imply that in a buy 2 get 1 free store and buying 15 items, the top 5 priciest items would be free. Yet, that doesnt appear to be what is expected.
After a quick investigation, I dont know what this Kata is validating. Example:
3 items in basket (13.95, 49.77, 35.82)
I expect to discount the highest priced item (49.77) and the total would be 13.95 + 35.82 - which is 49.77. But this Kata is expected 85.59 - which is 49.77 + 35.82. This is the oppisite of the desired behavior.