Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
put [start_watching]*2 into els solution in Clear category for Lightbulb Start Watching by tokyoamado
from datetime import datetime
from typing import List, Optional
def sum_light(els: List[datetime], start_watching: Optional[datetime] = None) -> int:
st = start_watching if start_watching else els[0]
els_ = sorted(els + [st] * 2)
return sum((b - a).total_seconds() for a, b in zip(*[iter(els_)] * 2) if b > st)
Nov. 18, 2020
Comments: