0
Code Coach - Super Sale. Failed Case #7
I've spotted no bugs, please assist if you can tell what's wrong. Here's the solution: https://sololearn.com/compiler-playground/cKK3Ken06e6b/?ref=app
4 Antworten
+ 1
There is one logical error: you do not account for the possibility that maxPrice may appear twice. But that does not seem to be the problem.
Rather, i couldn't figure out the purpose of line 67. So i took it out and the code ran fine :)
+ 1
I think the problem lies in the getSavings method. There are something in your calculations that doesn't quite make sense compared to the way I did it. You are making the calculations more complicated than they are.
The savings in the loop could be calculated as:
savings += (d * 0.3) * 1.07
+ 1
Thanks Ani Jona 🕊 it ran just fine
+ 1
Thanks for your contribution Jan