Ad
  • Custom User Avatar

    @fran_Cesco: No, that's not the case, read about integer division.

  • Custom User Avatar

    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.

  • Default User Avatar

    Resolved: Not an issue.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    I'm not sure what you mean with your question :) While this:

    quantity - quantity/3
    

    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).