728x90
Problem: py.checkio.org/en/mission/lightbulb-intro/
My solution
def sum_light(els: List[datetime]) -> int:
"""
how long the light bulb has been turned on
"""
time = 0
for n in range(len(els) // 2):
time += (els[2 * n + 1] - els[2*n]).total_seconds()
return int(time)
728x90
'프로그래밍 문제 > [Python] CheckIO' 카테고리의 다른 글
[CheckIO] Median (0) | 2021.03.23 |
---|---|
[CheckIO] Remove All After (0) | 2021.03.22 |
[CheckIO] Majority (0) | 2021.03.11 |
[CheckIO] Backward Each Word (0) | 2021.03.10 |
[Check-IO] Morse Decoder (0) | 2021.03.08 |
댓글