Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Call to Home by tokiojapan55
def total_cost(calls):
import math
totals = dict()
coins = 0
for bill in list(calls):
minutes = math.ceil(int(bill[20:]) / 60)
ymd = bill[:10]
day_total = totals.setdefault(ymd, 0)
if day_total >= 100:
coins += minutes * 2
elif (day_total + minutes) <= 100:
coins += minutes
else:
coins += minutes * 2 + day_total - 100
totals[ymd] = day_total + minutes
return coins
June 17, 2020
Comments: