diff options
author | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2021-12-05 15:18:59 +0700 |
---|---|---|
committer | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2021-12-05 15:18:59 +0700 |
commit | 85bd7ec1bd9cdc7ec53692fce5cae3118b7357a0 (patch) | |
tree | 1880d6822b4c1e6d978abb0dda073dd42755efad /aoc/2021/01/part-two.py | |
parent | 48f468b9b8a3f909b60399e277405b9723b8643a (diff) | |
download | cp-85bd7ec1bd9cdc7ec53692fce5cae3118b7357a0.tar.gz |
[aoc] Add first five/fifth
Diffstat (limited to 'aoc/2021/01/part-two.py')
-rw-r--r-- | aoc/2021/01/part-two.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/aoc/2021/01/part-two.py b/aoc/2021/01/part-two.py new file mode 100644 index 0000000..c8b0ac9 --- /dev/null +++ b/aoc/2021/01/part-two.py @@ -0,0 +1,8 @@ +from itertools import tee +from sys import stdin + +old, new = tee(map(int, stdin.read().strip().split())) +next(new) +next(new) +next(new) +print(sum(o < n for o, n in zip(old, new))) |