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 calculation is stated quite precisely: price per square inch, rounded upwards to the nearest cent. With such rounding, the cost comparison will result in more ties, and the final result will be based on diameter alone. I believe this is why your fork fails.
(Different orders of operations might still lead to inconsistent answers, but this should be vanishingly unlikely, especially given the transcendental nature of pi.)
There're different ways to calculate the ratio for comparing price-per-squared-inch values (e.g. this) but they don't work here since regardless of the approach there will be inaccuracies from floating point computations which will mess up the order of the elements, and no rounding will be able to fix this. Either the description should provide an exact formula to be used or all the inputs should be integers to enforce using the solution linked earlier.
The description is not clear at all, there's probably a trick to it but the 6kyu label doesn't warrant the time needed to complete.
Duplicate of all katas with problem statement as finding max with a key, (and the key is simple mathematical formula).
price
property doesn't seem to be limited to two decimal places.Role of coupons is not explained.
it seems to me you are contradicting your condition: "price and coupon will always be a number of no more than two decimal places (dollars)" in condition, and by example "price: 9.138753667456761" in random tests.