Day 5
authorBrett Parker <iDunno@sommitrealweird.co.uk>
Sat, 5 Dec 2020 12:54:46 +0000 (12:54 +0000)
committerBrett Parker <iDunno@sommitrealweird.co.uk>
Sat, 5 Dec 2020 12:54:46 +0000 (12:54 +0000)
day5/get_seat_id.py [new file with mode: 0644]
day5/input.txt [new file with mode: 0644]
day5/summary.txt [new file with mode: 0644]

diff --git a/day5/get_seat_id.py b/day5/get_seat_id.py
new file mode 100644 (file)
index 0000000..1b83889
--- /dev/null
@@ -0,0 +1,63 @@
+#!/usr/bin/python3
+
+def get_row(binary_id):
+    choices=binary_id[:7]
+
+    selections=[a for a in range(128)]
+
+    for decision in choices:
+        half_range=int(len(selections)/2)
+        if decision == 'F':
+            del selections[-half_range:]
+        elif decision == 'B':
+            del selections[:half_range]
+
+    return selections[0]
+
+def get_col(binary_id):
+    choices=binary_id[-3:]
+
+    selections=[a for a in range(8)]
+
+    for decision in choices:
+        half_range=int(len(selections)/2)
+        if decision == 'L':
+            del selections[-half_range:]
+        elif decision == 'R':
+            del selections[:half_range]
+
+    return selections[0]
+
+def get_seat(binary_id):
+    row=get_row(binary_id)
+    col=get_col(binary_id)
+
+    return ((row,col))
+
+def get_seat_id(row, col):
+    return ((row * 8) + col)
+
+all_seat_ids=[]
+
+for line in open("input.txt", "r"):
+    line = line.rstrip()
+
+    (row, col) = get_seat(line)
+    all_seat_ids.append(get_seat_id(row, col))
+
+# sort the list
+all_seat_ids.sort()
+
+# and print the highest seat id - part 1
+print("Highest seat id: {}".format(all_seat_ids[-1]))
+
+
+# part 2
+my_seat_id=None
+
+for a,b in enumerate(all_seat_ids, start=all_seat_ids[0]):
+    if a != b:
+        my_seat_id=a
+        break
+
+print("My seat id: {}".format(my_seat_id))
diff --git a/day5/input.txt b/day5/input.txt
new file mode 100644 (file)
index 0000000..c6d87c9
--- /dev/null
@@ -0,0 +1,850 @@
+BFFBFBBRLR
+FFFFBBBLRR
+FFFFBBFLRL
+BFFBBFFLRR
+BFFBFBBLRR
+F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over a new problem: you dropped your boarding pass! You aren't sure which seat is yours, and all of the flight attendants are busy with the flood of people that suddenly made it through passport control.
+
+You write a quick program to use your phone's camera to scan all of the nearby boarding passes (your puzzle input); perhaps you can find your seat through process of elimination.
+
+Instead of zones or groups, this airline uses binary space partitioning to seat people. A seat might be specified like FBFBBFFRLR, where F means "front", B means "back", L means "left", and R means "right".
+
+The first 7 characters will either be F or B; these specify exactly one of the 128 rows on the plane (numbered 0 through 127). Each letter tells you which half of a region the given seat is in. Start with the whole list of rows; the first letter indicates whether the seat is in the front (0 through 63) or the back (64 through 127). The next letter indicates which half of that region the seat is in, and so on until you're left with exactly one row.
+
+For example, consider just the first seven characters of FBFBBFFRLR:
+
+Start by considering the whole range, rows 0 through 127.
+F means to take the lower half, keeping rows 0 through 63.
+B means to take the upper half, keeping rows 32 through 63.
+F means to take the lower half, keeping rows 32 through 47.
+B means to take the upper half, keeping rows 40 through 47.
+B keeps rows 44 through 47.
+F keeps rows 44 through 45.
+The final F keeps the lower of the two, row 44.
+The last three characters will be either L or R; these specify exactly one of the 8 columns of seats on the plane (numbered 0 through 7). The same process as above proceeds again, this time with only three steps. L means to keep the lower half, while R means to keep the upper half.
+
+For example, consider just the last 3 characters of FBFBBFFRLR:
+
+Start by considering the whole range, columns 0 through 7.
+R means to take the upper half, keeping columns 4 through 7.
+L means to take the lower half, keeping columns 4 through 5.
+The final R keeps the upper of the two, column 5.
+So, decoding FBFBBFFRLR reveals that it is the seat at row 44, column 5.
+
+Every seat also has a unique seat ID: multiply the row by 8, then add the column. In this example, the seat has ID 44 * 8 + 5 = 357.
+
+Here are some other boarding passes:
+
+BFFFBBFRRR: row 70, column 7, seat ID 567.
+FFFBBBFRRR: row 14, column 7, seat ID 119.
+BBFFBBFRLL: row 102, column 4, seat ID 820.
+As a sanity check, look through your list of boarding passes. What is the highest seat ID on a boarding pass?
+
+Your puzzle answer was 885.
+
+--- Part Two ---
+Ding! The "fasten seat belt" signs have turned on. Time to find your seat.
+
+It's a completely full flight, so your seat should be the only missing boarding pass in your list. However, there's a catch: some of the seats at the very front and back of the plane don't exist on this aircraft, so they'll be missing from your list as well.
+
+Your seat wasn't at the very front or back, though; the seats with IDs +1 and -1 from yours will be in your list.
+
+What is the ID of your seat?
+
+Your puzzle answer was 623.
+
+Both parts of this puzzle are complete! They provide two gold stars: **
+
+At this point, you should return to your Advent calendar and try another puzzle.
+
+If you still want to see it, you can get your puzzle input.
+
+You can also [Share] this puzzle.