Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Just math.ceil with defaultdict solution in Clear category for Call to Home by swagg010164
from collections import defaultdict
from math import ceil
def total_cost(calls) -> int:
stat = defaultdict(int)
for call in calls:
date, time, length = call.split()
stat[date] += ceil(int(length)/60)
ans = 0
for k in stat:
ans += min(100, stat[k])
if stat[k] > 100:
ans += (stat[k] - 100)*2
return ans
June 27, 2020
Comments: