Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
11-liner: cost is 2 times coins when price gt 100 solution in Clear category for Call to Home by Stensen
from collections import defaultdict
from datetime import date
from math import ceil
def total_cost(calls, cost=0):
d = defaultdict(list)
for day in calls:
date, _, duration = day.split()
d[date].append(ceil(int(duration)/60))
for call in d.values():
cost += 2*sum(call)-100 if sum(call) > 100 else sum(call)
return cost
Nov. 10, 2020
Comments: