summaryrefslogtreecommitdiff
path: root/day5/main.py
diff options
context:
space:
mode:
authorCody Hiar <cody@hiar.ca>2021-02-05 10:43:34 -0700
committerCody Hiar <cody@hiar.ca>2021-02-05 10:43:34 -0700
commit3bb23093ae15aaa2b11c3b3d771d6a9e42b73a0c (patch)
treeaf03e0bb986a3bff0c76d5dfe9a949ac3b942e54 /day5/main.py
parentb4a3bd52e5e610f431d9aa49e3ac0af918e1e344 (diff)
day 7 part 1
Diffstat (limited to 'day5/main.py')
-rw-r--r--day5/main.py18
1 files changed, 0 insertions, 18 deletions
diff --git a/day5/main.py b/day5/main.py
deleted file mode 100644
index b544b61..0000000
--- a/day5/main.py
+++ /dev/null
@@ -1,18 +0,0 @@
-"""Peter Norvig solution. Forgot to do day 5."""
-data = map(str.strip, open("input"))
-
-ID = int
-
-def seat_id(seat: str, table=str.maketrans('FLBR', '0011')) -> ID:
- "Treat a seat description as a binary number; convert to int."
- return ID(seat.translate(table), base=2)
-
-
-ids = [seat_id(x) for x in data]
-
-# Part 1
-print(max(ids))
-
-# Part 2
-[missing] = set(range(min(ids), max(ids))) - set(ids)
-print(missing)