summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2021-12-03 15:18:06 +0000
committerTomasz Kramkowski <tk@the-tk.com>2021-12-03 15:18:06 +0000
commitb5d1f2d79bb61afd9b03621282b7bff5f29a75f1 (patch)
tree8ea6cb2b092f31be7e4561128e1618d0dffd000e
parenta0fa20b89afea02a863eab262099aee92019beae (diff)
downloadaoc2021-b5d1f2d79bb61afd9b03621282b7bff5f29a75f1.tar.gz
aoc2021-b5d1f2d79bb61afd9b03621282b7bff5f29a75f1.tar.xz
aoc2021-b5d1f2d79bb61afd9b03621282b7bff5f29a75f1.zip
day 1: a little bit cleaner
-rw-r--r--1.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/1.py b/1.py
index f439f46..2cc64a1 100644
--- a/1.py
+++ b/1.py
@@ -1,5 +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)))
+inp: list[int] = list(map(int, open('1.in')))
+print(sum(s[0] < s[1] for s in sliding_window(inp, 2)))
+print(sum(s[0] < s[3] for s in sliding_window(inp, 4)))