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.
@fran_Cesco: No, that's not the case, read about integer division.
I believe that the test cases have been luckily tailored to allow this solution. 9 mangos that cost 5 each cost 30 in total. But if you apply the above with 8 mangos costing 5 each you should get the same result (you are not taking advantage of 1 free mango) but instead you get a float which makes no sense because the result should always be a multiple of 5.
Resolved: Not an issue.
I'm not sure what you mean with your question :) While this:
means you drop every third mango from the calculation (because it's free by definition), your snippet -
((quantity / 3 ) * 2) * 2
- is not mathematically equivalent to the former (hint: integer division is not exactly like float division).This comment is hidden because it contains spoiler information about the solution
why is it that this does pass the Kata but #((quantity / 3 ) * 2) * 2 * price will not do the trick if they return the same value when calculated in a scientific calculator? Just curious I am new here.