2018: d01: ex1: add solution

This commit is contained in:
Bruno BELANYI 2024-12-29 14:32:33 -05:00
parent dae2865c13
commit 54895fc874

20
2018/d01/ex1/ex1.py Executable file
View file

@ -0,0 +1,20 @@
#!/usr/bin/env python
import sys
def solve(input: str) -> int:
def parse(input: list[str]) -> list[int]:
return [int(n) for n in input]
deltas = parse(input.splitlines())
return sum(deltas)
def main() -> None:
input = sys.stdin.read()
print(solve(input))
if __name__ == "__main__":
main()