Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
7-liner: convert datetime to total seconds solution in Clear category for Lightbulb Intro by Stensen
from datetime import datetime
from operator import sub
from typing import List
def sum_light(els: List[datetime]) -> int:
it = iter(els)
return sum(sub(*reversed((next(it), next(it)))).total_seconds()
for _ in range(len(els)//2))
Feb. 3, 2021
Comments: