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 kurosawa4434
from re import match
from math import ceil
def total_cost(calls):
total = {}
for call in calls:
m = match('(^.+) .+ ([0-9]+)', call)
d = m.group(1)
mi = int(m.group(2))
total[d] = total.get(d, 0) + ceil(mi / 60)
return sum(m if m < 100 else 100 + (m - 100) * 2 for m in total.values())
July 24, 2016
Comments: