2019: d01: ex1: add solution
This commit is contained in:
parent
589a7efaa4
commit
2d4c51a7ce
15
2019/d01/ex1/ex1.py
Executable file
15
2019/d01/ex1/ex1.py
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
import sys
|
||||||
|
from typing import List
|
||||||
|
|
||||||
|
|
||||||
|
def solve(nums: List[int]) -> int:
|
||||||
|
return sum(num // 3 - 2 for num in nums)
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
print(solve(list(int(lines) for lines in sys.stdin)))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
Loading…
Reference in a new issue