2021: d01: ex1: add solution

This commit is contained in:
Bruno BELANYI 2021-12-01 10:43:29 +01:00
parent dcd66ec6f4
commit 74e43afa72

17
2021/d01/ex1/ex1.py Executable file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env python
import sys
from typing import List
def solve(input: List[int]) -> int:
return sum(prev < cur for (prev, cur) in zip(input, input[1:]))
def main() -> None:
input = [int(line) for line in sys.stdin.readlines()]
print(solve(input))
if __name__ == "__main__":
main()