2022: d01: ex1: add solution

This commit is contained in:
Bruno BELANYI 2022-12-01 09:57:05 +01:00
parent 8c13d5954e
commit 24610576bb

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

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