[Community Puzzle] The leaking bathtub

Hello, any hints on validator #4, please? I pass all tests and other validators but fail this one. Tried playing around with precision and edge cases without success.

Great puzzle overall but would really benefit from having more test cases, it’s not a good sign when multiple people report passing all tests and failing validators.

Do the custom cases here help you? If not, you may send me your code in private message and I’ll try to come up with a custom case for you.

Ugh.
non-integer math. :face_vomiting:

Although, it can be done in integers if your GCDs and LCMs are up to speed!

Use fractions, it’s integer maths. :muscle:

i fail test 1 and validator 4
for test 1:
21.25;;12750;;20;;60;;11;;1
0:21:15
50.1591;;12750;;45;;60;;8;;3
0:50:9.54545
01:14:02
Trouvé :
01:14:02
Attendu :
01:14:08

i don’t understand the reason for the error on test 1 and on the validator 4 that is without leak

For test 1, your figure is 50.1591, but my figure is 50.2273. You may start debugging by investigating what the issue is with this calculation.

thanks, i had a variable integer instead double in the calculate.
shame, a beginner mistake, i forget to verify my type

1 Like

Thanks for the examples ; I immediately found the flaw in my code.