Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Too many max and min solution in Clear category for Call to Home by u8m_
def total_cost(calls):
rec = {}
for x in calls:
d,t,c = str(x).split()
cup = int(c)/60 + (int(c)%60 != 0)
if d in rec:
rec[d] += min(cup,100-min(rec[d],100)) + max(2*(cup-100+min(rec[d],100)),0)
else:
rec[d] = min(cup,100) + max(2*(cup-100),0)
return sum(rec.values())
Nov. 18, 2015