diff --git a/2018/d01/ex1/ex1.py b/2018/d01/ex1/ex1.py new file mode 100755 index 0000000..bcffca7 --- /dev/null +++ b/2018/d01/ex1/ex1.py @@ -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()