Problem 35 - Savings Calculator

Back to Problem Solutions forum

Curio_Amigo     2020-09-01 10:46:41

Hello my dears, I got stuck at the problem #35 - Savings Calculator. I've revised all kinds of trouble that could been and appear into the code, but I can't be able to know why it dosen't give the correct answer. I suspect that the checker is give an incorret answer.

Rodion (admin)     2020-09-02 07:01:25
User avatar

I suspect that the checker is give an incorret answer.

That's probable :) 2919 persons have solved this incorrectly, then.

Please, don't be evil and give example of what makes you think checker is wrong - input data, your answer and expected answer.

Curio_Amigo     2020-09-02 07:18:21

input data:

data = [50, 150, 30, 500, 4000, 5, 50, 500, 4, 25, 375, 3, 10000, 150000, 2, 2500, 45000, 50, 1000, 20000, 1, 2500, 37500, 20, 5000, 70000, 2, 1000, 20000, 2, 5000, 75000, 30, 500, 5500, 9, 10000, 250000, 2, 25, 275, 5, 25, 625, 2, 250, 4000, 15, 5000, 10000, 15]

my answer: 5 43 59 92 137 8 302 15 134 152 11 28 163 50 163 20 5 expected answer: 5 43 59 92 137 8 302 15 134 152 11 28 163 50 164 20 5

Rodion (admin)     2020-09-02 17:47:04
User avatar

Ah, ok, please note problem statement says "rounded DOWN to whole cents", even outlined. Your code rounds differently!

Curio_Amigo     2020-09-03 05:51:06

Thanks very much for advice! I was able to solve the problem rounded down to whole cents.

Please login and solve 5 problems to be able to post at forum