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.
First of all, I would like to say that I appreciate the people who spend time and create the katas.
Thank you.
I just want you to know that I am not just criticizing by posting this.
I want to understand what is going on so I can attempt this kata.
In general, I don't understand how the bogof items work. I know what it stands for. But, how can there ever be an odd amount for them? If you buy one, you get a free one. There is always an even number.
Specifically: In the one example in the description, the amount for Chocolate is 5 and OJ is 15. This is supposed to return 26.25 according to the description. So, to work it out on paper...err...in the computer...whatever...
OJ would be:
15 .x 1.5 = 22.5
22.5 - 2.25 (10% discount) = 20.25
So, that means the Chocolate should cost $6. No discount amount.
How is this calculated with a price of 2?
The only thing I can figure out is that you would round up to the next integer for half of an odd item amount for a bogof item to solve this kata. So, you would use 3 for this test case.
PHP Translation Kumited - please carefully review and approve :D