Piotr Czajkowski 3 years ago
parent
commit
ea8a0282bd
3 changed files with 1033 additions and 0 deletions
  1. 54 0
      day5/challenge.txt
  2. 162 0
      day5/day5.c
  3. 817 0
      day5/input.txt

+ 54 - 0
day5/challenge.txt

@@ -0,0 +1,54 @@
+--- Day 5: Binary Boarding ---
+
+You board your plane only to discover 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 901.
+--- 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 661.

+ 162 - 0
day5/day5.c

@@ -0,0 +1,162 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define ROW_SIZE 11
+#define ROW_LIMIT 7
+#define COLUMN_LIMIT 10
+#define ROW_MAX 127
+#define COLUMN_MAX 7
+
+int arraySize = 0;
+
+char **readInput(char *path) {
+	char **array = NULL;
+	FILE *fp = fopen(path, "r");
+	if (!fp) {
+		puts("Can't read");
+		return NULL;
+	}
+
+	int index = 0;
+	while (1) {
+		if (feof(fp)) break;
+
+		char *p = malloc(ROW_SIZE);
+		if (!p) return NULL;
+
+		if (1 > fscanf(fp, "%s\n", p))
+			return NULL;
+
+		arraySize++;
+		char **newArray = realloc(array, sizeof(char*)*arraySize);
+		if (!newArray) return NULL;
+		array = newArray;
+		array[index] = p;
+		index++;
+	}
+
+	fclose(fp);
+	return array;
+}
+
+int establishRow(char *code) {
+	int rowMin = 0;
+	int current = 0;
+	int rowMax = ROW_MAX;
+	for (int i = 0; i < ROW_LIMIT; i++) {
+		if (code[i] == 'F') {
+			rowMax = ((rowMax - rowMin) / 2) + rowMin;
+			current = rowMin;
+		}
+
+		if (code[i] == 'B') {
+			rowMin = ((rowMax - rowMin) / 2) + rowMin + 1;
+			current = rowMax;
+		}
+	}
+
+	return current;
+}
+
+int establishColumn(char *code) {
+	int columnMin = 0;
+	int current = 0;
+	int columnMax = COLUMN_MAX;
+	for (int i = ROW_LIMIT; i < COLUMN_LIMIT; i++) {
+		if (code[i] == 'L') {
+			columnMax = ((columnMax - columnMin) / 2) + columnMin;
+			current = columnMin;
+		}
+
+		if (code[i] == 'R') {
+			columnMin = ((columnMax - columnMin) / 2) + columnMin + 1;
+			current = columnMax;
+		}
+	}
+
+	return current;
+}
+
+int highestID(char **array) {
+	int highest = 0;
+	for (int i = 0; i < arraySize; i++) {
+		int current = (establishRow(array[i]) * 8) + establishColumn(array[i]);
+		if (current > highest) highest = current;
+	}
+
+	return highest;
+}
+
+int **calculateIDs(char **array) {
+	int **IDS = malloc(sizeof(int*)*arraySize);
+	if (!IDS) return NULL;
+
+	for (int i = 0; i < arraySize; i++) {
+		int current = (establishRow(array[i]) * 8) + establishColumn(array[i]);
+		IDS[i] = malloc(sizeof(int));
+		if (!IDS[i]) return NULL;
+		*IDS[i] = current;
+	}
+
+	return IDS;
+}
+
+int isTaken(int id, int **IDS) {
+	for (int i = 0; i < arraySize; i++)
+		if (*IDS[i] == id) return 1;
+
+	return 0;
+}
+
+int findSeat(int **IDS) {
+	for (int i = 0; i < arraySize; i++) {
+		for (int j = i + 1; j < arraySize; j++) {
+			if ((*IDS[i] - *IDS[j] == 2) || (*IDS[i] - *IDS[j] == -2)) {
+				int min = *IDS[i] < *IDS[j] ? *IDS[i] : *IDS[j];
+				int seat = min + 1;
+				if (!isTaken(seat, IDS)) return seat;
+			}
+		}
+
+	}
+	return 0;
+}
+
+void freeArray(char **array) {
+	for (int i = 0; i < arraySize; i++)
+		free(array[i]);
+
+	free(array);
+}
+
+void freeIDS(int **IDS) {
+	for (int i = 0; i < arraySize; i++)
+		free(IDS[i]);
+
+	free(IDS);
+}
+
+int main(int argc, char **argv)
+{
+	if (argc < 2) {
+		puts("You need to specify path to file!");
+		return -1;
+	}
+
+	char **array = readInput(argv[1]);
+	if (!array) {
+		puts("Can't read array!");
+		return -1;
+	}
+
+	printf("Part1: %d\n", high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