That's because 2.35 is the conversion factor from mpg to kpl of a US gallon. The kata is specifically asking about imperial gallons, which are larger than US gallons. It's better to just use the numbers provided in the kata rather than search online for a conversion factor anyway, otherwise you are likely to run into rounding errors.
That's because 2.35 is the conversion factor from mpg to kpl of a US gallon. The kata is specifically asking about imperial gallons, which are larger than US gallons. It's better to just use the numbers provided in the kata rather than search online for a conversion factor anyway, otherwise you are likely to run into rounding errors.
in python, this doesn't work...
return mpg / 2.35
10 - 4.25 (rounded) - expected 3.54
typed on calculator, got 4.25 (again rounded)
the problem comes from your code. you do not use the appropriate datatypes (note the return type)
problem with big numbers at random test on C.
Mathematics are correct, idk what wrong with them. Example:
Submitted: 7.636e+07
Expected: 7.64e+07