summaryrefslogtreecommitdiffstats
path: root/1.py
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2021-12-01 08:29:46 +0000
committerTomasz Kramkowski <tk@the-tk.com>2021-12-01 10:18:48 +0000
commit1f88313cc4ff52f06b5c99ff2364910d8bc10e1d (patch)
tree3fc0bf35e2bed217dbbbe9fc6de7a61132bafe1a /1.py
downloadaoc2021-1f88313cc4ff52f06b5c99ff2364910d8bc10e1d.tar.gz
aoc2021-1f88313cc4ff52f06b5c99ff2364910d8bc10e1d.tar.xz
aoc2021-1f88313cc4ff52f06b5c99ff2364910d8bc10e1d.zip
day 1
Diffstat (limited to '1.py')
-rw-r--r--1.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/1.py b/1.py
new file mode 100644
index 0000000..f439f46
--- /dev/null
+++ b/1.py
@@ -0,0 +1,5 @@
+from utils import sliding_window
+
+inp: list[int] = [int(l.strip()) for l in open('1.in')]
+print(sum(s[1] > s[0] for s in sliding_window(inp, 2)))
+print(sum(s[3] > s[0] for s in sliding_window(inp, 4)))