Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
sum(dict.values) solution in Clear category for Call to Home by Olpag
from typing import List
def total_cost(calls: List[str]) -> int:
minutes = {}
for line in calls:
date, _, sec = line.split()
minutes[date] = minutes.get(date, 0) + int(sec)//60 + bool(int(sec)%60)
return sum((val, 100+(val-100)*2)[val>100] for val in minutes.values())
May 18, 2023