Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
defaultdict solution in Clear category for Call to Home by ciel
from collections import defaultdict
from operator import methodcaller
def total_cost(calls):
d=defaultdict(int)
for e in map(methodcaller('split'),calls): d[e[0]]+=(int(e[2])+59)//60
return sum(e if e<100 else 100+2*(e-100) for e in d.values())
May 21, 2014
Comments: