Compare commits

...

17 Commits

Author SHA1 Message Date
5d54a107d4 [TASK] Cleaned up (and improved the performance a little) for day 17 2021-12-19 14:53:25 +01:00
9fc38b9b88 [TASK] Solved Day 17 2021-12-19 14:42:04 +01:00
2c3c1f8f08 [WIP] Day 17 part 1 solved 2021-12-19 12:15:50 +01:00
da579fbfac [WIP] Trying to work on day 17 but I'm braindead 2021-12-17 19:56:46 +01:00
4137cef6f9 [TASK] Fixed some stuff in the last couple of days, so the firebase eslint is happy again 2021-12-16 22:57:29 +01:00
1e405e982a [TASK] Implemented Day 16 2021-12-16 22:54:40 +01:00
e3988e91b7 [TASK] Solved Day 15 (although there is room for speed improvements) 2021-12-16 21:13:18 +01:00
07b36d66d5 [TASK] Solved Day 14 2021-12-16 20:06:08 +01:00
888f40d341 [TASK] Finished Day 13 + some style fixes to make sure eslint is happy enough to deploy to firebase functions 2021-12-13 23:16:06 +01:00
33a8ce77e4 [TASK] Solved Day 12 2021-12-13 21:43:07 +01:00
ed88c69cea [TASK] Solved Day 11 2021-12-13 21:11:43 +01:00
3ad67df338 [CLEANUP] Made the code a little bit cleaner 2021-12-10 20:04:38 +01:00
168e55e5ef [TASK] Solved Day 10 2021-12-10 19:54:41 +01:00
28426f4e4e [TASK] Implemented Day 9 2021-12-09 23:25:27 +01:00
3a9184ae37 [TASK] Solved Day 8 2021-12-09 22:29:00 +01:00
ab613666e7 [TASK] Solved Day 7 2021-12-07 20:37:51 +01:00
95772849e4 [TASK] Implemented Day 6 2021-12-07 20:01:39 +01:00
44 changed files with 3482 additions and 6 deletions

View File

@@ -7,7 +7,8 @@
"shell": "npm run build && firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
"logs": "firebase functions:log",
"debug-day17": "ts-node src/day17.ts"
},
"engines": {
"node": "16"
@@ -24,6 +25,7 @@
"eslint-config-google": "^0.14.0",
"eslint-plugin-import": "^2.22.0",
"firebase-functions-test": "^0.2.0",
"ts-node": "^10.4.0",
"typescript": "^3.8.0"
},
"private": true

94
functions/src/Grid.ts Normal file
View File

@@ -0,0 +1,94 @@
import Vector2 from "./vector2";
class Grid<T> {
data: T[];
outOfBoundsResult?: T;
maxX: number;
maxY: number;
constructor(data: T[], maxX: number, outOfBoundsResult: T | undefined = undefined) {
if (data.length % maxX !== 0) throw Error("Invalid grid data length, must be a multiple of the width");
this.data = data;
this.outOfBoundsResult = outOfBoundsResult;
this.maxX = maxX;
this.maxY = this.data.length / maxX;
}
at(x: number, y: number): T {
if (!this.isInBounds(x, y)) {
if (this.outOfBoundsResult) {
return this.outOfBoundsResult
} else {
throw Error(`Invalid coordinate: (${x}, ${y})`);
}
}
return this.data[this.index(x, y)];
}
setAt(x: number, y: number, value: T): void {
if (!this.isInBounds(x, y)) {
throw Error(`Invalid coordinate: (${x}, ${y})`);
}
this.data[this.index(x, y)] = value;
}
allPositions(): Vector2[] {
const res =[];
for (let y = 0; y < this.maxY; y++) {
for (let x = 0; x < this.maxX; x++) {
res.push(new Vector2(x, y));
}
}
return res;
}
isInBounds(x: number, y: number): boolean {
return x >= 0 && x < this.maxX && y >= 0 && y < this.maxY;
}
inBoundsNeighbors(x: number, y: number, includeDiagonal = false): Vector2[] {
const res = [
new Vector2(x + 1, y),
new Vector2(x - 1, y),
new Vector2(x, y + 1),
new Vector2(x, y - 1)
];
if (includeDiagonal) {
res.push(
new Vector2(x + 1, y + 1),
new Vector2(x + 1, y - 1),
new Vector2(x - 1, y + 1),
new Vector2(x - 1, y - 1)
);
}
return res.filter(v => this.isInBounds(v.x, v.y));
}
/**
* Pastes the given grid into this grid, with it's top left position at the given coordinate
*/
paste(grid: Grid<T>, posX: number, posY: number): void {
if (posX + grid.maxX > this.maxX || posY + grid.maxY > this.maxY) throw Error(`Can't paste grid at (${posX}, ${posY}), this grid is not big enough`);
for (let y = 0; y < grid.maxY; y++) {
for (let x = 0; x < grid.maxX; x++) {
this.setAt(posX + x, posY + y, grid.at(x, y));
}
}
}
index(x: number, y: number): number {
return x + y * this.maxX;
}
}
export default Grid;

74
functions/src/day10.ts Normal file
View File

@@ -0,0 +1,74 @@
import Day from "./day";
import Utils from "./utils";
const BRACKETS: {[key: string]: string} = { "(": ")", "[": "]", "{": "}", "<": ">" };
const CORRUPT_CHARACTER_SCORES: {[key: string]: number} = { ")": 3, "]": 57, "}": 1197, ">": 25137 };
const MISSING_CHARACTER_SCORES: {[key: string]: number} = { ")": 1, "]": 2, "}": 3, ">": 4 };
class Day10 implements Day {
part1(input: string[]): number | string {
return Utils.sum(
input.map(s => this.checkSyntax(s))
.map(r => r.error === "corrupt" ? this.getCorruptCharacterScore(r.got) : 0)
);
}
part2(input: string[]): number | string {
const incompletenessScores = input
.map(s => this.checkSyntax(s))
.filter(r => r.error === "incomplete")
.map(r => r.error === "incomplete" ? this.calculateIncompletenessScore(r.missing) : 0);
incompletenessScores.sort((a, b) => a - b);
return incompletenessScores[Math.floor(incompletenessScores.length / 2)];
}
calculateIncompletenessScore(missing: string): number {
let score = 0;
for (const missingElement of missing) {
score *= 5;
score += MISSING_CHARACTER_SCORES[missingElement];
}
return score;
}
getCorruptCharacterScore(char: string): number {
return CORRUPT_CHARACTER_SCORES[char];
}
checkSyntax(line: string): { error: "corrupt", expected: string, got: string } | { error: "incomplete", missing: string } | { error: "none" } {
const stack = [];
for (const char of line) {
if (char in BRACKETS) {
stack.push(BRACKETS[char]);
} else {
const expected = stack[stack.length - 1];
if (expected === char) {
stack.pop();
} else {
return {error: "corrupt", expected, got: char};
}
}
}
if (stack.length === 0) {
return { error: "none" }
} else {
let missing = "";
while(stack.length > 0) {
missing += stack.pop();
}
return { error: "incomplete", missing }
}
}
}
export default Day10;

128
functions/src/day11.ts Normal file
View File

@@ -0,0 +1,128 @@
import Day from "./day";
class Day11 implements Day {
part1(input: string[]): number | string {
const grid = OctopusGrid.parse(input);
let flashTotal = 0;
for (let i = 0; i < 100; i++) {
flashTotal += grid.runStep();
}
return flashTotal;
}
part2(input: string[]): number | string {
const grid = OctopusGrid.parse(input);
let lastFlash = 0;
let step = 0;
while(lastFlash !== 100) {
lastFlash = grid.runStep();
step++;
}
return step;
}
}
class OctopusGrid {
grid: number[];
maxX: number;
maxY: number;
constructor(grid: number[], width: number) {
this.grid = grid;
this.maxX = width;
this.maxY = grid.length / width;
}
static parse(input: string[]): OctopusGrid {
const grid = input.map(l => l.split("").map(s => parseInt(s)))
.reduce((a, b) => [...a, ...b])
const width = input[0].length;
return new OctopusGrid(grid, width);
}
runStep(): number {
// First, the energy level of each octopus increases by 1.
this.grid = this.grid.map(o => o + 1);
// Then, any octopus with an energy level greater than 9 flashes. This increases the energy level of all adjacent
// octopuses by 1, including octopuses that are diagonally adjacent. If this causes an octopus to have an energy
// level greater than 9, it also flashes. This process continues as long as new octopuses keep having their energy
// level increased beyond 9. (An octopus can only flash at most once per step.)
const flashGrid = Array(this.grid.length).fill(false);
for (let y = 0; y < this.maxY; y++) {
for (let x = 0; x < this.maxX; x++) {
const i = this.index(x, y);
const cur = this.grid[i];
if (cur > 9 && !flashGrid[i]) {
this.flash(x, y, flashGrid);
}
}
}
// Finally, any octopus that flashed during this step has its energy level set to 0, as it used all of its energy to flash.
for (let y = 0; y < this.maxY; y++) {
for (let x = 0; x < this.maxX; x++) {
const i = this.index(x, y);
if (flashGrid[i]) {
this.grid[i] = 0;
}
}
}
return flashGrid.filter(f => f).length;
}
flash(x: number, y: number, flashGrid: boolean[]) {
flashGrid[this.index(x, y)] = true;
// Charge and if needed flash all neighbors
for (let ny = y - 1; ny <= y + 1; ny++) {
for (let nx = x - 1; nx <= x + 1 ; nx++) {
this.chargeAndFlashIfNeeded(nx, ny, flashGrid);
}
}
}
chargeAndFlashIfNeeded(x: number, y: number, flashGrid: boolean[]) {
// Short circuit for octopuses outside the grid
if (x < 0 || x >= this.maxX || y < 0 || y >= this.maxY) return;
const i = this.index(x, y);
this.grid[i] += 1;
if (this.grid[i] > 9 && !flashGrid[i]) {
this.flash(x, y, flashGrid)
}
}
index(x: number, y: number): number {
return x + y * this.maxX;
}
toString(): string {
const lines = [];
for (let y = 0; y < this.maxY; y++) {
let line = "";
for (let x = 0; x < this.maxX; x++) {
line += this.grid[this.index(x, y)];
}
lines.push(line);
}
return lines.join("\n");
}
}
export default Day11;

72
functions/src/day12.ts Normal file
View File

@@ -0,0 +1,72 @@
import Day from "./day";
class Day12 implements Day {
part1(input: string[]): number | string {
const caves = this.parseInput(input);
return this.countPaths("start", caves, []);
}
part2(input: string[]): number | string {
const caves = this.parseInput(input);
return this.countPaths("start", caves, [], true);
}
private parseInput(input: string[]) {
const caves = new Map<string, string[]>();
for (const line of input) {
const splitIndex = line.indexOf("-");
const from = line.substr(0, splitIndex);
const to = line.substr(splitIndex + 1);
this.addPath(from, to, caves);
this.addPath(to, from, caves);
}
return caves;
}
addPath(from: string, to: string, caves: Map<string, string[]>): void {
const existing = caves.get(from);
if (existing) {
existing.push(to);
} else {
caves.set(from, [to]);
}
}
countPaths(pos: string, caves: Map<string, string[]>, visited: string[], secondSmallVisitAllowed = false): number {
// If we reached the end, there is exactly one path
if (pos === "end") return 1;
const destinations = caves.get(pos);
if (!destinations) {
throw Error(`No paths from ${pos}`);
}
const newVisited = [...visited];
if (this.isSmall(pos)) {
newVisited.push(pos);
}
let sum = 0;
for (const destination of destinations) {
if (!this.isSmall(destination) || !visited.includes(destination)) {
sum += this.countPaths(destination, caves, newVisited, secondSmallVisitAllowed)
} else if (secondSmallVisitAllowed && destination !== "start") {
sum += this.countPaths(destination, caves, newVisited, false)
}
}
return sum;
}
isSmall(cave: string): boolean {
return cave.toLowerCase() === cave;
}
}
export default Day12;

100
functions/src/day13.ts Normal file
View File

@@ -0,0 +1,100 @@
import Day from "./day";
import Vector2 from "./vector2";
class Day13 implements Day {
part1(input: string[]): number | string {
const {dots, folds} = this.parseInput(input);
const foldedDots = dots.map(d => folds[0].apply(d));
return new Set(foldedDots.map(d => d.key())).size;
}
part2(input: string[]): number | string {
const {dots, folds} = this.parseInput(input);
let foldedDots = [...dots];
for (const fold of folds) {
foldedDots = foldedDots.map(d => fold.apply(d));
}
return this.renderDots(dots);
}
private parseInput(input: string[]): { dots: Vector2[], folds: Fold[] } {
const dots = input.filter(s => s.trim() !== "" && !s.startsWith("fold"))
.map(s => Vector2.parse(s));
const folds = input.filter(s => s.startsWith("fold"))
.map(s => Fold.parseInstruction(s));
return {dots, folds};
}
renderDots(dots: Vector2[]): string {
const minX = Math.min(...dots.map(d => d.x));
const maxX = Math.max(...dots.map(d => d.x));
const minY = Math.min(...dots.map(d => d.y));
const maxY = Math.max(...dots.map(d => d.y));
const lines = [];
for (let y = minY; y <= maxY; y++) {
let line = "";
for (let x = minX; x <= maxX; x++) {
line += dots.some(d => d.x === x && d.y === y) ? "#" : ".";
}
lines.push(line);
}
return lines.join("\n");
}
}
class Fold {
axis: "x" | "y";
foldPosition: number;
constructor(axis: "x" | "y", position: number) {
this.axis = axis;
this.foldPosition = position;
}
static parseInstruction(line: string): Fold {
if (line.startsWith("fold along y=")) {
return new Fold("y", parseInt(line.substr(13)));
} else if (line.startsWith("fold along x=")) {
return new Fold("x", parseInt(line.substr(13)));
} else {
throw Error(`Invalid fold instruction: "${line}"`);
}
}
apply(pos: Vector2) {
if (this.axis === "y") {
return new Vector2(pos.x, this.foldAlong(pos.y));
} else {
return new Vector2(this.foldAlong(pos.x), pos.y);
}
}
private foldAlong(pos: number): number {
if (pos < this.foldPosition) return pos;
if (pos === this.foldPosition) console.log("Excuse me WTF?");
const distanceToFold = pos - this.foldPosition - 1;
return this.foldPosition - distanceToFold - 1;
}
}
export default Day13;

151
functions/src/day14.ts Normal file
View File

@@ -0,0 +1,151 @@
import Day from "./day";
import Utils from "./utils";
type CharCounts = {[key: string]: bigint};
class Day14 implements Day {
part1(input: string[]): number | string {
const { orig, mapping } = Day14.parseInput(input);
let current = orig;
for (let step = 0; step < 10; step++) {
current = this.executeStep(current, mapping);
}
const counts: {[key: string]: number} = {};
for (const c of current) {
if (c in counts) {
counts[c]++;
} else {
counts[c] = 1;
}
}
return Math.max(...Object.values(counts)) - Math.min(...Object.values(counts));
}
private static parseInput(input: string[]): { orig: string, mapping: Map<string, Map<string, string>>} {
const orig = input[0];
const mapping = new Map<string, Map<string, string>>();
for (const line of input.slice(2)) {
const splitIndex = line.indexOf("->");
const from = line.substr(0, splitIndex).trim();
const firstChar = from[0];
const secondChar = from[1];
const to = line.substr(splitIndex + 2).trim();
const existingMapping = mapping.get(firstChar);
if (existingMapping) {
existingMapping.set(secondChar, to);
} else {
mapping.set(firstChar, new Map<string, string>([[secondChar, to]]));
}
}
return { orig, mapping };
}
private executeStep(orig: string, mapping: Map<string, Map<string, string>>): string {
let res = "";
for (let i = 0; i < orig.length - 1; i++) {
const char = orig[i];
res += char;
const firstCharMatch = mapping.get(char);
if (firstCharMatch) {
const secondChar = orig[i + 1];
const toAdd = firstCharMatch.get(secondChar);
if (toAdd) {
res += toAdd;
}
}
}
// Add the last character as it's not included in the result
res += orig[orig.length - 1];
return res;
}
part2(input: string[]): number | string {
const { orig, mapping } = Day14.parseInput(input);
const counts: CharCounts = {};
const cache = new Map<string, CharCounts>();
for (let i = 0; i < orig.length - 1; i++) {
const firstChar = orig[i];
const secondChar = orig[i + 1];
this.addOne(firstChar, counts);
this.mergeIntoLeft(counts, this.calculateRecursive(firstChar, secondChar, mapping, 40, cache));
}
this.addOne(orig[orig.length - 1], counts);
return (Utils.bigMax(Object.values(counts)) - Utils.bigMin(Object.values(counts))).toString();
}
/**
* Returns the amount of added element of each type
*/
calculateRecursive(firstChar: string, secondChar: string, mappings: Map<string, Map<string, string>>, stepsLeft: number, cache: Map<string, CharCounts>): CharCounts {
if (stepsLeft === 0) return {};
const cacheKey = firstChar + secondChar + stepsLeft;
const cachedResult = cache.get(cacheKey);
if (cachedResult) return cachedResult;
const res = {};
const firstCharMatch = mappings.get(firstChar);
if (firstCharMatch) {
const toAdd = firstCharMatch.get(secondChar);
if (toAdd) {
this.addOne(toAdd, res);
this.mergeIntoLeft(res, this.calculateRecursive(firstChar, toAdd, mappings, stepsLeft - 1, cache));
this.mergeIntoLeft(res, this.calculateRecursive(toAdd, secondChar, mappings, stepsLeft - 1, cache));
}
}
cache.set(cacheKey, res);
return res;
}
mergeIntoLeft(left: CharCounts, right: CharCounts): void {
for (const rightKey in right) {
if (rightKey in left) {
left[rightKey] += right[rightKey];
} else {
left[rightKey] = right[rightKey];
}
}
}
addOne(char: string, counts: CharCounts): void {
if (char in counts) {
counts[char]++;
} else {
counts[char] = 1n;
}
}
// calculateCounts(pair: string, mappings: Map<string, Map<string, string>>, cache: Map<string, Map<number, {[key: string]: bigint}>>): {[key: string]: bigint} {
//
//
//
// }
}
export default Day14;

80
functions/src/day15.ts Normal file
View File

@@ -0,0 +1,80 @@
import Day from "./day";
import Grid from "./Grid";
import Vector2 from "./vector2";
class Day15 implements Day {
part1(input: string[]): number | string {
return this.findLowestRiskScore(Day15.parseInput(input));
}
part2(input: string[]): number | string {
const grid = Day15.parseInput(input);
const bigGrid = new Grid(Array((grid.maxX * 5) * (grid.maxY * 5)).fill(0), grid.maxX * 5, Number.MAX_SAFE_INTEGER);
for (let y = 0; y < 5; y++) {
for (let x = 0; x < 5; x++) {
const subGrid = new Grid(grid.data.map(c => c + x + y).map(c => c > 9 ? c % 9 : c), grid.maxX);
bigGrid.paste(subGrid, x * grid.maxX, y * grid.maxY);
}
}
return this.findLowestRiskScore(bigGrid);
}
private findLowestRiskScore(grid: Grid<number>): number {
const start = new Vector2(0, 0);
const destination = new Vector2(grid.maxX - 1, grid.maxY - 1);
const distances = new Grid(new Array(grid.data.length).fill(Number.MAX_SAFE_INTEGER), grid.maxX);
distances.setAt(start.x, start.y, 0);
const searchStack = [start];
while (searchStack.length > 0) {
// Simulate a priority queue on distance:
searchStack.sort((a, b) => distances.at(b.x, b.y) - distances.at(a.x, a.y));
const cur = searchStack.pop();
if (!cur) throw Error("???");
if (cur.x === destination.x && cur.y === destination.y) {
break;
}
const curDist = distances.at(cur.x, cur.y);
const neighbors = grid.inBoundsNeighbors(cur.x, cur.y);
for (const neighbor of neighbors) {
const newDist = curDist + grid.at(neighbor.x, neighbor.y);
if (newDist < distances.at(neighbor.x, neighbor.y)) {
distances.setAt(neighbor.x, neighbor.y, newDist);
searchStack.push(neighbor);
}
}
}
return distances.at(destination.x, destination.y);
}
private static parseInput(input: string[]): Grid<number> {
return new Grid<number>(
input.flatMap(l => l.split("").map(n => parseInt(n))),
input[0].length, Number.MAX_SAFE_INTEGER);
}
}
export default Day15;

150
functions/src/day16.ts Normal file
View File

@@ -0,0 +1,150 @@
import Day from "./day";
import Utils from "./utils";
class Day16 implements Day {
part1(input: string[]): number | string {
const packet = Packet.parse(input[0]);
return Day16.recursiveSumVersionNumbers(packet);
}
part2(input: string[]): number | string {
return Packet.parse(input[0]).calculateValue().toString();
}
static recursiveSumVersionNumbers(packet: Packet): number {
if (typeof packet.content === "bigint") {
return packet.version;
} else {
return packet.version + Utils.sum(packet.content.map(sp => Day16.recursiveSumVersionNumbers(sp)));
}
}
}
class Packet {
static readonly SUM_TYPE = 0
static readonly PROD_TYPE = 1;
static readonly MIN_TYPE = 2;
static readonly MAX_TYPE = 3;
static readonly LITERAL_TYPE = 4;
static readonly GT_TYPE = 5;
static readonly LT_TYPE = 6;
static readonly EQ_TYPE = 7;
static readonly VERSION_LENGTH = 3;
static readonly TYPE_LENGTH = 3;
static readonly LENGTH_TYPE_LENGTH = 1;
static readonly SUBPACKET_SIZE_LENGTH = 15;
static readonly SUBPACKET_COUNT_LENGTH = 11;
static readonly LITERAL_PART_LENGTH = 5;
version: number;
type: number;
content: Packet[] | bigint
binaryLength: number;
constructor(version: number, type: number, content: Packet[] | bigint, binaryLength: number) {
this.version = version;
this.type = type;
this.content = content;
this.binaryLength = binaryLength;
}
calculateValue(): bigint {
if (typeof this.content === "bigint") return this.content;
const subValues = this.content.map(c => c.calculateValue());
if (this.type === Packet.SUM_TYPE) {
return Utils.bigSum(subValues)
} else if (this.type === Packet.PROD_TYPE) {
return subValues.reduce((a, b) => a * b, 1n);
} else if (this.type === Packet.MIN_TYPE) {
return Utils.bigMin(subValues);
} else if (this.type === Packet.MAX_TYPE) {
return Utils.bigMax(subValues);
} else if (this.type === Packet.GT_TYPE) {
return subValues[0] > subValues[1] ? 1n : 0n;
} else if (this.type === Packet.LT_TYPE) {
return subValues[0] < subValues[1] ? 1n : 0n;
} else if (this.type === Packet.EQ_TYPE) {
return subValues[0] === subValues[1] ? 1n : 0n;
} else {
// Shouldn't happen
throw Error("Unsupported packet type: " + this.type);
}
}
static parse(input: string): Packet {
return this.parseBinaryInput(Packet.toBinary(input));
}
static toBinary(input: string): string {
return input.split("").map(s => parseInt(s, 16).toString(2).padStart(4, "0")).join("");
}
static parseBinaryInput(binaryInput: string, start = 0): Packet {
const version = parseInt(binaryInput.substr(start, Packet.VERSION_LENGTH), 2);
const type = parseInt(binaryInput.substr(start + Packet.VERSION_LENGTH, Packet.TYPE_LENGTH), 2);
const contentStart = start + Packet.VERSION_LENGTH + Packet.TYPE_LENGTH;
if (type === Packet.LITERAL_TYPE) {
// Literal value
let i = 0;
let binaryLiteral = "0b";
do {
binaryLiteral += binaryInput.substr(contentStart + (Packet.LITERAL_PART_LENGTH * i) + 1, Packet.LITERAL_PART_LENGTH - 1);
i++;
} while(binaryInput[contentStart + (Packet.LITERAL_PART_LENGTH * (i - 1))] === "1")
return new Packet(version, type, BigInt(binaryLiteral), Packet.VERSION_LENGTH + Packet.TYPE_LENGTH + (Packet.LITERAL_PART_LENGTH * i))
} else {
// Operator packets, so let's parse the subpackets:
const lengthType = binaryInput[contentStart];
if (lengthType === "0") {
const subpacketsLength = parseInt(binaryInput.substr(contentStart + Packet.LENGTH_TYPE_LENGTH, Packet.SUBPACKET_SIZE_LENGTH), 2);
const firstPacketStart = contentStart + Packet.LENGTH_TYPE_LENGTH + Packet.SUBPACKET_SIZE_LENGTH;
let curStart = firstPacketStart;
const subPackets = [];
while (curStart - firstPacketStart < subpacketsLength) {
const subPacket = this.parseBinaryInput(binaryInput, curStart);
curStart += subPacket.binaryLength;
subPackets.push(subPacket);
}
return new Packet(version, type, subPackets, curStart - start);
} else {
const subpacketCount = parseInt(binaryInput.substr(contentStart + Packet.LENGTH_TYPE_LENGTH, Packet.SUBPACKET_COUNT_LENGTH), 2);
let curStart = contentStart + Packet.LENGTH_TYPE_LENGTH + Packet.SUBPACKET_COUNT_LENGTH;
const subPackets = [];
for (let i = 0; i < subpacketCount; i++) {
const subPacket = this.parseBinaryInput(binaryInput, curStart);
curStart += subPacket.binaryLength;
subPackets.push(subPacket);
}
return new Packet(version, type, subPackets, curStart - start);
}
}
}
}
export default Day16;

199
functions/src/day17.ts Normal file
View File

@@ -0,0 +1,199 @@
import Day from "./day";
class Day17 implements Day {
// steps = 3
// y = 1 -> 1 + 0 + -1 = 0
// y = 2 -> 2 + 1 + 0 = 3
// y = 3 -> 3 + 2 + 1 = 6
// y = 4 -> 4 + 3 + 2 = 9
// y = 5 -> 5 + 4 + 3 = 12
// steps = 4
// y = 1 -> -2
// y = 2 -> 2
// y = 3 -> 6
// y = 4 -> 10
// y = 0
// steps = 1 -> 0 = 0
// steps = 2 -> 0 - 1 = -1
// steps = 3 -> 0 - 1 - 2 = -3
// steps = 4 -> 0 - 1- 2 - 3= -6
// steps = 5 -> 0-1-2-3-4 = -10
// steps = 6 -> 0-1-2-3-4-5 = -15
part1(input: string[]): number | string {
const targetArea = TargetArea.parse(input[0]);
// Assuming v_y0 > 0, the maximum height the probe reaches is triangle(y).
// After reaching the top, the probe starts falling back down, taking "v_y0" steps to get back to a height of 0.
// After that it has a speed of v_y0 - 1.
// Note that the triangle value of x must be at least the minimal x of the target area, otherwise the probe won't
// reach the target area before it's velocity reaches zero:
const v_x0_min = Day17.triangleInvCeil(targetArea.minX);
// Calculate the x-position we reach after v_x0 steps:
const x_min = Day17.triangle(v_x0_min);
if (targetArea.isInX(x_min)) {
// We have an x-speed that reaches the target area in x_min steps and stays there (e.g. reaches velocity zero in the target area),
// so we can just find the biggest y that at some point ends up in the target area.
// We already know that the y speed when the "probe" comes down is:
// -v_y0 - 1
// So if we choose as starting y that is one higher than the minimal y value, we end up in the bottom of the target area, while
// reaching the maximum height:
const v_y0_max = Math.abs(targetArea.minY) - 1;
return Day17.triangle(v_y0_max);
} else {
throw Error("Unsupported target area, only a target area with an x values that is a triangle number is supported");
}
}
part2(input: string[]): number | string {
const targetArea = TargetArea.parse(input[0]);
const v_x0_min = Day17.triangleInvCeil(targetArea.minX);
const v_x0_max_static = Day17.triangleInvFloor(targetArea.maxX);
const maxYStepsBelowZero = Day17.triangleInvCeil(Math.abs(targetArea.minY));
let solutionCount = 0;
for (let v_x0 = v_x0_min; v_x0 <= targetArea.maxX; v_x0++) {
for (let v_y0 = targetArea.minY; v_y0 < Math.abs(targetArea.minY); v_y0++) {
// If v_x0 <= v_x0_max_static, we end up in a position where eventually all x-es fall in the valid range
// So in that case, we base the max steps on the y values.
const maxSteps = v_x0 <= v_x0_max_static
? (v_y0 < 0 ? maxYStepsBelowZero : 2 * v_y0 + 1 + maxYStepsBelowZero)
: v_x0_max_static;
for (let steps = 1; steps <= maxSteps; steps++) {
const xRangeResult = this.isInXAfterSteps(v_x0, steps, targetArea);
if (xRangeResult === RangeResult.TOO_HIGH) {
break;
} if (xRangeResult === RangeResult.YES) {
// Check what y values work for this x and step count:
const yRangeResult = this.isInYAfterSteps(v_y0, steps, targetArea);
if (yRangeResult === RangeResult.YES) {
// console.log(`${v_x0}, ${v_y0}`)
solutionCount++;
break;
}
}
}
}
}
return solutionCount;
}
isInXAfterSteps(v_x0: number, steps: number, targetArea: TargetArea): RangeResult {
if (steps >= v_x0) {
// reached final position, which is the triangle number of the initial speed:
return targetArea.isInX(Day17.triangle(v_x0));
} else {
// On our way to the final position:
const x = Day17.triangle(v_x0) - Day17.triangle(v_x0 - steps);
return targetArea.isInX(x);
}
}
isInYAfterSteps(v_y0: number, steps: number, targetArea: TargetArea): RangeResult {
if (targetArea.maxY >= 0) throw Error("Only target area's below the starting point are supported")
if (v_y0 > 0) {
if (steps < 2 * v_y0) {
// We haven't gone below the
return RangeResult.TOO_HIGH;
} else {
// This is equivalent to firing with a negative y speed after v_y0 * 2 + 1 steps (so the steps left = steps - 2 * v_y0 - 1)
return this.isInYAfterSteps(-v_y0 - 1, steps - 2 * v_y0 - 1, targetArea);
}
} else {
// Firing downward:
const y = - Day17.calcPositionAfterIncreasingVelocity(Math.abs(v_y0), steps);
return targetArea.isInY(y);
}
}
static calcPositionAfterIncreasingVelocity(v: number, steps: number): number {
if (v < 0) throw Error("Velocity must be positive");
return Day17.triangle(v - 1 + steps) - Day17.triangle(v - 1);
}
static triangle(n: number): number {
return (n*(n + 1)) / 2;
}
static triangleInvCeil(x: number): number {
return Math.ceil(this.triangleInv(x));
}
static triangleInvFloor(x: number): number {
return Math.floor(this.triangleInv(x));
}
static triangleInv(x: number): number {
return (Math.sqrt(8 * x + 1) - 1) / 2;
}
}
enum RangeResult {
TOO_LOW = -1,
TOO_HIGH = 0,
YES = 1
}
class TargetArea {
minX: number;
maxX: number;
minY: number;
maxY: number;
constructor(minX: number, maxX: number, minY: number, maxY: number) {
this.minX = minX;
this.maxX = maxX;
this.minY = minY;
this.maxY = maxY;
}
static parse(input: string): TargetArea {
const regex = /^target area: x=(-?[0-9]+)\.\.(-?[0-9]+), y=(-?[0-9]+)..(-?[0-9]+)$/i;
const match = input.trim().match(regex);
if (!match || match.length < 5) {
throw Error("Invalid input: '" + input + "'");
}
return new TargetArea(
parseInt(match[1]),
parseInt(match[2]),
parseInt(match[3]),
parseInt(match[4]),
)
}
isInX(x: number): RangeResult {
if (x < this.minX) return RangeResult.TOO_LOW;
else if (x > this.maxX) return RangeResult.TOO_HIGH;
else return RangeResult.YES;
}
isInY(y: number): RangeResult {
if (y < this.minY) return RangeResult.TOO_LOW;
else if (y > this.maxY) return RangeResult.TOO_HIGH;
else return RangeResult.YES;
}
}
export default Day17;

35
functions/src/day6.ts Normal file
View File

@@ -0,0 +1,35 @@
import Day from "./day";
import Utils from "./utils";
class Day6 implements Day {
part1(input: string[]): number | string {
const initial = input[0].split(",").map(s => parseInt(s));
return this.countFishAfter(initial, 80).toString(10);
}
part2(input: string[]): number | string {
const initial = input[0].split(",").map(s => parseInt(s));
return this.countFishAfter(initial, 256).toString(10);
}
countFishAfter(initial: number[], days: number): bigint {
// We represent the data as the number of glowfish in a specific state per day, then we can just shift that array around:
const fishStates = Array(9).fill(0n);
initial.forEach(f => fishStates[f]++);
for (let i = 0; i < days; i++) {
const reproducingFish = fishStates.shift()
fishStates[6] += reproducingFish;
fishStates.push(reproducingFish);
}
return Utils.bigSum(fishStates);
}
}
export default Day6;

45
functions/src/day7.ts Normal file
View File

@@ -0,0 +1,45 @@
import Day from "./day";
import Utils from "./utils";
class Day7 implements Day {
part1(input: string[]): number | string {
const initialPositions = input[0].split(",").map(s => parseInt(s));
initialPositions.sort((a, b) => a - b);
// The optimal position is just the median:
const pos = initialPositions[Math.floor(initialPositions.length / 2)];
// So we calculate the fuel usage in that position
return Utils.sum(initialPositions.map(p => Math.abs(pos - p)));
}
part2(input: string[]): number | string {
const initialPositions = input[0].split(",").map(s => parseInt(s));
const min = Math.min(...initialPositions);
const max = Math.max(...initialPositions);
const fuelUsage = Array(max + 1);
let lastFuel = 0;
for (let i = 0; i < fuelUsage.length; i++) {
fuelUsage[i] = lastFuel + i;
lastFuel = fuelUsage[i];
}
let bestFoundFuelCost = Number.MAX_SAFE_INTEGER;
for (let pos = min; pos < max; pos++) {
const fuelCost = Utils.sum(initialPositions.map(p => fuelUsage[Math.abs(pos - p)]));
if (fuelCost < bestFoundFuelCost) {
bestFoundFuelCost = fuelCost;
}
}
return bestFoundFuelCost;
}
}
export default Day7;

166
functions/src/day8.ts Normal file
View File

@@ -0,0 +1,166 @@
import Day from "./day";
import Utils from "./utils";
const FULL = "abcdefg";
const SIGNAL_DISPLAYS = [
"abcefg", "cf", "acdeg", "acdfg", "bcdf", "abdfg", "abdefg", "acf", "abcdefg", "abcdfg"
]
class Day8 implements Day {
part1(input: string[]): number | string {
const signals = input.map(line => Signal.parse(line));
return Utils.sum(signals.map(s => s.outputValues.filter(o =>
o.length === SIGNAL_DISPLAYS[1].length ||
o.length === SIGNAL_DISPLAYS[4].length ||
o.length === SIGNAL_DISPLAYS[7].length ||
o.length === SIGNAL_DISPLAYS[8].length).length));
}
part2(input: string[]): number | string {
const signals = input.map(line => Signal.parse(line));
return Utils.sum(signals.map(s => s.decode()));
}
}
class Signal {
readonly inputValues: string[];
readonly outputValues: string[];
constructor(inputValues: string[], outputValues: string[]) {
this.inputValues = inputValues;
this.outputValues = outputValues;
}
static parse(line: string): Signal {
const split = line.split(/\s*\|\s*/)
return new Signal(
split[0].split(/\s+/),
split[1].split(/\s+/)
);
}
decode(): number {
const values = [...this.inputValues, ...this.outputValues];
// mappings maps the signal values to all possible correct wires (we'll filter this later on)
const mappings: {[key: string]: string} = { "a": FULL, "b": FULL, "c": FULL, "d": FULL, "e": FULL, "f": FULL, "g": FULL };
// First, we use the "easy" (EZ) numbers. We know that every value of length must map to:
// 2 is a 1: cf
// 4 is a 4: acdfg
// 3 is a 7: acf
// 7 is an 8, but that doesn't give any additional information (since it maps to everything anyway)
for (const nr of [1, 4, 7]) {
const ezSignal = SIGNAL_DISPLAYS[nr];
const ezCoded = values.find(v => v.length === ezSignal.length);
if (ezCoded) {
for (const ezCodedSymbol of ezCoded) {
mappings[ezCodedSymbol] = Signal.intersect(ezSignal, mappings[ezCodedSymbol]);
}
}
}
// 0, 6 and 9 all miss one bar (length of 6). The only bars that can be missing are:
// 0: d
// 6: c
// 9: e
// So we can use this to deduct that the missing element in every number of length 6, must map to either d, c, or e
const lengthSixValues = values.filter(v => v.length === 6);
for (const value of lengthSixValues) {
for (const codedSymbol of FULL) {
if (!value.includes(codedSymbol)) {
mappings[codedSymbol] = Signal.intersect("cde", mappings[codedSymbol]);
}
}
}
// 2, 3 and 5 all miss two bars:
// 2: b, f
// 3: b, e
// 5: c, e
// So this means that the two missing elements in every number of length 5 must map to either b, c, e or f:
const lengthFiveValues = values.filter(v => v.length === 5);
for (const value of lengthFiveValues) {
for (const codedSymbol of FULL) {
if (!value.includes(codedSymbol)) {
mappings[codedSymbol] = Signal.intersect("bcef", mappings[codedSymbol]);
}
}
}
// By now, we probably know some mappings for sure (only one possibility), so we can remove the sure ones from the mappings:
let toClean = FULL;
let cleanedThisRound = "xxx";
while(toClean.length > 0 && cleanedThisRound.length > 0) {
cleanedThisRound = "";
for (const codedSymbol of toClean) {
if (mappings[codedSymbol].length === 1) {
const decodedSymbol = mappings[codedSymbol];
Object.keys(mappings).filter(cs => cs != codedSymbol)
.forEach(cs => mappings[cs] = Signal.removeMapping(mappings[cs], decodedSymbol));
cleanedThisRound += codedSymbol;
}
}
for (const cleanedSymbol of cleanedThisRound) {
toClean = toClean.replace(cleanedSymbol, "");
}
}
let res = 0;
for (let i = 0; i < this.outputValues.length; i++) {
const codedValue = this.outputValues[i];
const scale = Math.pow(10, this.outputValues.length - i - 1)
res += SIGNAL_DISPLAYS.indexOf(Signal.sort(this.applyMapping(codedValue, mappings))) * scale;
}
return res;
}
private static intersect(map1: string, map2: string): string {
let res = "";
for (const char of map1) {
if (map2.includes(char)) {
res += char;
}
}
return res;
}
private static removeMapping(mapping: string, decodedSymbol: string): string {
return mapping.replace(decodedSymbol, "");
}
private applyMapping(value: string, mapping: {[key: string]: string}): string {
let res = "";
for (const codedSymbol of value) {
res += mapping[codedSymbol];
}
if (res.length !== value.length) {
throw Error("Mapping is incomplete for signal: " + this.inputValues.join(" ") + " | " + this.outputValues.join(" "));
}
return res;
}
private static sort(value: string): string {
let res = "";
for (const c of FULL) {
if (value.includes(c)) {
res += c;
}
}
return res;
}
}
export default Day8;

122
functions/src/day9.ts Normal file
View File

@@ -0,0 +1,122 @@
import Day from "./day";
import Vector2 from "./vector2";
import Utils from "./utils";
class Day9 implements Day {
part1(input: string[]): number | string {
const heightMap = HeightMap.parseInput(input);
const lowPoints = heightMap.findLowPoints();
return Utils.sum(lowPoints.map(lp => heightMap.height(lp.x, lp.y) + 1));
}
part2(input: string[]): number | string {
const heightMap = HeightMap.parseInput(input);
const basins = heightMap.findBasins();
basins.sort((a, b) => b.size - a.size);
return basins[0].size * basins[1].size * basins[2].size;
}
}
class HeightMap {
readonly heightMap: number[];
readonly width: number;
readonly maxY: number;
constructor(heightMap: number[], width: number) {
this.heightMap = heightMap;
this.width = width;
this.maxY = this.heightMap.length / width;
}
static parseInput(input: string[]): HeightMap {
const width = input[0].length;
const heightMap = [];
for (const line of input) {
if (line.length !== width) {
throw Error("Invalid input");
}
heightMap.push(...line.split("").map(s => parseInt(s)));
}
return new HeightMap(heightMap, width);
}
height(x: number, y: number): number {
if (x < 0 || x >= this.width || y < 0 || y >= this.maxY) return 9;
return this.heightMap[x + y * this.width];
}
findLowPoints(): Vector2[] {
const res = [];
for (let y = 0; y < this.maxY; y++) {
for (let x = 0; x < this.width; x++) {
if (this.isLowPoint(x, y)) {
res.push(new Vector2(x, y));
}
}
}
return res;
}
isLowPoint(x: number, y: number): boolean {
const height = this.height(x, y);
return height < this.height(x - 1, y) &&
height < this.height(x + 1, y) &&
height < this.height(x, y - 1) &&
height < this.height(x, y + 1);
}
findBasins(): Basin[] {
const lowPoints = this.findLowPoints();
// From every low point, we start to grow "upwards" to claim every point that is part of it's basin:
const basinIds = Array(this.width * this.maxY).fill(-1);
for (let i = 0; i < lowPoints.length; i++) {
const stack: Vector2[] = [lowPoints[i]];
while(stack.length > 0) {
const pos = stack.pop();
if (!pos) {
throw Error("Stack is empty?")
}
const posHeight = this.height(pos.x, pos.y);
basinIds[pos.x + pos.y * this.width] = i;
// We add all neighbors to the stack that are low enough, and haven't been assigned to a basin:
const neighbors = [pos.addX(1), pos.addX(-1), pos.addY(1), pos.addY(-1)];
for (const neighbor of neighbors) {
const neighborHeight = this.height(neighbor.x, neighbor.y);
if (neighborHeight < 9 && neighborHeight > posHeight && basinIds[neighbor.x + neighbor.y * this.width] === -1) {
stack.push(neighbor);
}
}
}
}
return lowPoints.map((lp, i) => new Basin(lp, basinIds.filter(b => b === i).length));
}
}
class Basin {
readonly lowPoint: Vector2;
readonly size: number;
constructor(lowPoint: Vector2, size: number) {
this.lowPoint = lowPoint;
this.size = size;
}
}
export default Day9;

View File

@@ -7,6 +7,18 @@ import Day2 from "./day2";
import Day3 from "./day3";
import Day4 from "./day4";
import Day5 from "./day5";
import Day6 from "./day6";
import Day7 from "./day7";
import Day8 from "./day8";
import Day9 from "./day9";
import Day10 from "./day10";
import Day11 from "./day11";
import Day12 from "./day12";
import Day13 from "./day13";
import Day14 from "./day14";
import Day15 from "./day15";
import Day16 from "./day16";
import Day17 from './day17';
// // Start writing Firebase Functions
@@ -28,6 +40,18 @@ export const day = {
3: functions.region("europe-west1").https.onRequest((request, response) => { processDay(new Day3(), request, response) }),
4: functions.region("europe-west1").https.onRequest((request, response) => { processDay(new Day4(), request, response) }),
5: functions.region("europe-west1").https.onRequest((request, response) => { processDay(new Day5(), request, response) }),
6: functions.region("europe-west1").https.onRequest((request, response) => { processDay(new Day6(), request, response) }),
7: functions.region("europe-west1").https.onRequest((request, response) => { processDay(new Day7(), request, response) }),
8: functions.region("europe-west1").https.onRequest((request, response) => { processDay(new Day8(), request, response) }),
9: functions.region("europe-west1").https.onRequest((request, response) => { processDay(new Day9(), request, response) }),
10: functions.region("europe-west1").https.onRequest((request, response) => { processDay(new Day10(), request, response) }),
11: functions.region("europe-west1").https.onRequest((request, response) => { processDay(new Day11(), request, response) }),
12: functions.region("europe-west1").https.onRequest((request, response) => { processDay(new Day12(), request, response) }),
13: functions.region("europe-west1").https.onRequest((request, response) => { processDay(new Day13(), request, response) }),
14: functions.region("europe-west1").https.onRequest((request, response) => { processDay(new Day14(), request, response) }),
15: functions.region("europe-west1").https.onRequest((request, response) => { processDay(new Day15(), request, response) }),
16: functions.region("europe-west1").https.onRequest((request, response) => { processDay(new Day16(), request, response) }),
17: functions.region("europe-west1").https.onRequest((request, response) => { processDay(new Day17(), request, response) }),
}

View File

@@ -14,7 +14,19 @@ class Utils {
}
static sum(values: number[]): number {
return values.reduce((a, b) => a + b, 0);
return values.reduce((a, b) => a + b);
}
static bigSum(values: bigint[]): bigint {
return values.reduce((a, b) => a + b);
}
static bigMax(values: bigint[]): bigint {
return values.reduce((a, b) => a > b ? a : b);
}
static bigMin(values: bigint[]): bigint {
return values.reduce((a, b) => a < b ? a : b);
}
static zeroes(length: number): number[] {

View File

@@ -18,6 +18,14 @@ class Vector2 {
key(): string {
return `${this.x},${this.y}`;
}
addX(x: number): Vector2 {
return new Vector2(this.x + x, this.y);
}
addY(y: number): Vector2 {
return new Vector2(this.x, this.y + y);
}
}
export default Vector2;

View File

@@ -6,7 +6,7 @@
"outDir": "lib",
"sourceMap": true,
"strict": true,
"target": "es2017"
"target": "es2020"
},
"compileOnSave": true,
"include": [

View File

@@ -23,6 +23,18 @@
chalk "^2.0.0"
js-tokens "^4.0.0"
"@cspotcode/source-map-consumer@0.8.0":
version "0.8.0"
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz#33bf4b7b39c178821606f669bbc447a6a629786b"
integrity sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==
"@cspotcode/source-map-support@0.7.0":
version "0.7.0"
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz#4789840aa859e46d2f3173727ab707c66bf344f5"
integrity sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==
dependencies:
"@cspotcode/source-map-consumer" "0.8.0"
"@eslint/eslintrc@^0.4.3":
version "0.4.3"
resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c"
@@ -278,6 +290,26 @@
resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf"
integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==
"@tsconfig/node10@^1.0.7":
version "1.0.8"
resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9"
integrity sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==
"@tsconfig/node12@^1.0.7":
version "1.0.9"
resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.9.tgz#62c1f6dee2ebd9aead80dc3afa56810e58e1a04c"
integrity sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==
"@tsconfig/node14@^1.0.0":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.1.tgz#95f2d167ffb9b8d2068b0b235302fafd4df711f2"
integrity sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==
"@tsconfig/node16@^1.0.2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.2.tgz#423c77877d0569db20e1fc80885ac4118314010e"
integrity sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==
"@types/body-parser@*":
version "1.19.2"
resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.2.tgz#aea2059e28b7658639081347ac4fab3de166e6f0"
@@ -474,11 +506,21 @@ acorn-jsx@^5.3.1:
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"
integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==
acorn-walk@^8.1.1:
version "8.2.0"
resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1"
integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==
acorn@^7.4.0:
version "7.4.1"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa"
integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==
acorn@^8.4.1:
version "8.6.0"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.6.0.tgz#e3692ba0eb1a0c83eaa4f37f5fa7368dd7142895"
integrity sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw==
agent-base@6:
version "6.0.2"
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77"
@@ -530,6 +572,11 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0:
dependencies:
color-convert "^2.0.1"
arg@^4.1.0:
version "4.1.3"
resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089"
integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==
argparse@^1.0.7:
version "1.0.10"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
@@ -745,6 +792,11 @@ cors@^2.8.5:
object-assign "^4"
vary "^1"
create-require@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==
cross-spawn@^7.0.2:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
@@ -814,6 +866,11 @@ dicer@^0.3.0:
dependencies:
streamsearch "0.1.2"
diff@^4.0.1:
version "4.0.2"
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==
doctrine@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d"
@@ -1903,6 +1960,11 @@ make-dir@^3.0.0:
dependencies:
semver "^6.0.0"
make-error@^1.1.1:
version "1.3.6"
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==
media-typer@0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
@@ -2515,6 +2577,24 @@ tr46@~0.0.3:
resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=
ts-node@^10.4.0:
version "10.4.0"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.4.0.tgz#680f88945885f4e6cf450e7f0d6223dd404895f7"
integrity sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==
dependencies:
"@cspotcode/source-map-support" "0.7.0"
"@tsconfig/node10" "^1.0.7"
"@tsconfig/node12" "^1.0.7"
"@tsconfig/node14" "^1.0.0"
"@tsconfig/node16" "^1.0.2"
acorn "^8.4.1"
acorn-walk "^8.1.1"
arg "^4.1.0"
create-require "^1.1.0"
diff "^4.0.1"
make-error "^1.1.1"
yn "3.1.1"
tsconfig-paths@^3.11.0:
version "3.12.0"
resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz#19769aca6ee8f6a1a341e38c8fa45dd9fb18899b"
@@ -2740,6 +2820,11 @@ yargs@^16.1.1:
y18n "^5.0.5"
yargs-parser "^20.2.2"
yn@3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"
integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==
yocto-queue@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"

15
input/day/10-example.http Normal file
View File

@@ -0,0 +1,15 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-10
Content-Type: text/plain
[({(<(())[]>[[{[]{<()<>>
[(()[<>])]({[<{<<[]>>(
{([(<{}[<>[]}>{[]{[(<()>
(((({<>}<{<{<>}{[]{[]{}
[[<[([]))<([[{}[[()]]]
[{[{({}]{}}([{[{{{}}([]
{<[[]]>}<{[{[{[]{()[[[]
[<(<(<(<{}))><([]([]()
<{([([[(<>()){}]>(<<{{
<{([{{}}[<[[[<>{}]]]>[]]
###

99
input/day/10.http Normal file
View File

@@ -0,0 +1,99 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-10
Content-Type: text/plain
({[[{[(([({((<[]>{[][]})[{<>[]}{[]{}}])[<[<><>][[]{}]>{[{}()][{}]}]}(<[{<>{}}[()]]<[{}[]]>><[{()}({}())]
[[<([<<<((([<<()()>{{}()}>[[()<>]]]{<{<>[]}(()<>)>[<{}{}>[{}]]}){{({<>()}{[]})<[[][]]>}[{[
[{{<{({<<({{{<[]><<>[]>}{{()()}(<>[])}}<[{(){}}<<>{}>]((<>[]){{}{}})>}([[{[]<>]][(<>[])(()<>)]])){[
[<([({{{<{[[[{{}{}}]{<[]()>([]}}][({()()}){<()<>><(){}>}]]<<(<[][]>({}{}))([[]<>]<[]()>)>{({<>[]}{
[{(({<({(<(({<[]{}>(<>())}[([]()){()<>}]){<<(){}>{()<>}>[{<>{}}{<>()}]})({[<<>()><{}[]>]})>)[{([[{(){
(<(({[<{[{[{<[()<>](()[])>}[<[()<>]((){})>([<>[]][[]{}])]]([[[[][]](()[])]<(<><>)<[]<>>>][{(<>{})}<<[]{}>[{}(
<[[<[{[<[[<<([{}[]][{}<>])<<<>()>([]{})>><((())[(){}])({<>()}{[]()})}>({(([]{})<{}[]>){{(){}}[[][]]}}
<{(<<<<{{({{((()())<<>{}>)([<>()][[]()])}[[{[][]}]<<()<>>[()<>]>]})}<<[<<({}<>>[[]<>]><[()[]]{{}{}}>>]<<
<[[[{<({(<{[((()()))]<{<()>{<><>}}((<>{})[{}[]])>}>)>)<((<<[{([]<>)([]<>)}[[[]{}](()[])]]({{()[]}})>{
{[{[<<[<[<{[{{{}[]}[[]()]}{[[]<>]([]<>)}]<((()<>){<>()}){<[]()>{[]()}}>})<[{<{[]{}}[<>]><([]
<(<{[[{((<({((<>())<()<>>)<(<><>)<(){}>>}]({<[{}{}]{()<>}><<()<>>(<>())>}[{[<>[]][<><>]}<({}()){()()}>
[(([<{<[({{[<[(){}](()[])>]<<<[]()>{{}[]}><{()}(<>())>>}[<[{{}()}[<>{}]]>(<[<>[]]<()[]>>{<()><{}<>
{<[<<[{[([[[{<{}<>>{()[]}}[<[]()>([]<>)]][<{[]{}}{[]<>}>]]{[([(){}]{()<>}>{[<>{}][<>()]}]{<[{}
[[<{<<{{{(<({[<>[]]}{<(){}>[<>[]]}){([[]{}])({[]{}}(<>[]))}><<<{[]()}{<>()}>{(<>)<()[]>}>[[({}<>)((
<(<(({<<[(<[{([]()){[][]}}<(()[])>]><[[{()<>}[()[]]]({{}<>}{<>()})][(<[]()>[{}()])[([]{})[
(<[{<<[{<[([([()[]][[]{}])]{{(()<>)}[[(){}](()<>)]})]>([(([([][])[<>[]]]<<[]<>>>)[{<()[]>(()[])}({<
({(([<<<<<((<{{}{}}<()<>>>[<[][]>[{}<>]])([(<>()){()[]}]<<<><>>[{}<>]>>){([[{}{}][[]()]]<<[][]><[]
(((<{({{([[<<<(){}><{}<>>>>[{{[]<>}(()[])}(<[][]>[()])]]]<(({{{}[]}{<>{}}}[{<>{}}[()()]])[<[{}<>](()
<(([<<{[[{{{{(()[])([]{})}}{<<{}{}>{{}<>}>[{{}{}}<()()>]}}[{[((){})((){}]]}{<(<>[])<{}[]>>[<[]<>>({}<>)]
{([{([{[{<([<<{}()>[(){}]>(<<>{}>[<>{}])])[({[[]()]<[]{}>}<{{}{}}>)<[{<><>}](<[]<>>[{}<>])>]>}]}])[{{{[
[(<{(([{{{({([[][]][()[]])}<<<()[]><()>><(<>{})<<><>>>>)<{[[<><>]<{}[]>]}>}([(<{<><>}{{}[]}>[[<>()](<><>)
(<(((<{(<[({([<>[]]{{}{}}){[[]{}][()<>]}}{[{(){}}[()<>]]<<<>[]>([][])>})][<{<[[]<>]((){})>([<>()]<(){}>)}>]>)
[{{[(({(<<[({{{}{}}<[][]>}([<>][[]{}]))]<<((<>())<()[]>)<({}())<{}[]>>>>>>)}{<<[{[[(<>()){<><>}]<(
<[[[((<{[<{(<[[]()]>){[{()<>}[<>()]]<{<><>}[[]<>]>}}[<([{}{}])({[]<>}[[]])><({()[]}(<>{}))[<
<{<<[<[<(([<{<(){}>({}())}{<<>>[[][]]}>[(<{}()>{(){}})(<[]><{}{}>)]]<((((){}){<><>})<{{}[]}
[(<[<(<{({{<(<{}{}>{{}()})<{[][]}{{}[]}>>(<((){})(()[])>{(<>())})}})<<<[[([]<>)([]<>)]{(<>
(({<[<{{<{<[(({}())[[]{}])<{<>[]}(()<>)>]([(<>[])<[]()>]([[]()){{}()}))>}>[({<(([][])({}{}))<{{}[]}[<>
((({({{[[(<{<<[]()><[]{}>><(()[])[{}()]>}[{[<>()]([])}{{{}{}}<()()]}]>)<{<[[<>{}][[]()]]({<>()}{<><>})>
{[[[[((<<<{[{([][]){<>{}}}[<<>()>([]{})]](<((){})<{}()>><([]())[<><>}>)}{{[[(){}]]{<<>[]><[]{}>}}<({(){
({[[[(({<({[{[<>[]][{}{}]}<<<>>{<>{}}>]<{[{}<>]{()[]}}>}<<([[]{}]({}{}])>{[[<>[]]({}<>)]([{}[]]
{{{({{[{({{<{{()[]}{{}[]}}{<{}{}>}>{(({}())[()<>])((<>{})([]))}}}]<<[(((()<>)<(){}>){[[][]]{{}
{({<{<[{({[{{<<>>[{}{}]}[[<>[]]<{}[]>]}[<[()()]{[]}><([]<>){<>[]}>]]})}[({<[<<{}<>>(()[])>]<({{}(
[{((<{<({[{<[(()()){<><>}](<{}{}>{[][]})>[{<{}()><[]()>}]}][(<({[]{}})>)<<[({}{}){[]()}]{((){}){()[
{<<<{({[(<{<{<()<>>([][]]}<(<>[])[()[]]>>}>)]}[{[{[{[<{}[]>]({()[]}<()()>)}][[[[{}()]{<>{}}][[[
{[{{{{[((<{[[([]<>){{}[]}][<[]{}>({}{})]][[{<>()}[()[]]]<<[]{}><<>{}>>]}{{{[[]<>]<{}()>}[[[]()]{<>()
(([<[[[{{((<(<(){}>[[]<>]){{<><>}([][])}>{[{{}[]}{()[]}]<<{}<>><[]>>}))}({({[[<><>]<[]{}>][{<
[(<({[<[<<(<{([]{})(<>())}<{{}[]}{[]{}}>><(([]<>)[(){}])>)[<{[[]{}]([]{})}[<[][]>(()<>)]>{<{<>()}(()<>)>(<(
[{<(<((<{[(<{<<>()>}<<<>[]><<><>>>><{<()[]><()()>}{[(){}]{[]{}}}>)<{([<>{}][()>)<{[]{}}([][])>}>]({{<({}
({(<[<<{<(((<[{}<>]<<>()>><([]<>)>)[[<<>>{{}<>}](<{}<>>)])[{<[{}]<{}{}>><<[]<>>{[][]}>}}){(({(
(([([{{<<<{({[<>[]]<<>>}({()<>}))({(<>{})(()[])))}((<([]<>){<>[]}>(<[][]>{()<>})){([()()]{(){}})((<>())<{
[{{[<<<((<[([{()<>}<()[]>][(()<>)])({<()<>>({}<>)}{{()<>}{()()}})]>[(<([()[]]<(){}>){[{}<>]{{}{}}}>[([
[(({<[[[<<[[{[()()][{}()]}[[()<>]([]<>)]][<<<><>>[[]<>]><[()<>]<<>()>>]]([{{()[]}{()()}}]{([()[]]({}))<<[]
<[<(<(({<([<<[[]()]<[]<>>>[{[]()}<(){}>]>{<[{}[]]{[]{}}>[<{}<>>]}][<(<{}<>>{()<>})[{<><>}{[]()}]
[{[<<{{{{{{{[{[]<>}{[]{}}]}[[(<>())([][])]<({}[]}[{}[]]>]}{{<<[]<>>[[]<>]>}[[([]{})({}{})]([
({[({[[{{[{[[{<>[]}(()<>)][<()()><[][]>]]{{{<>[]}<<>[]>}<[<>{}]<[][]>>}}<(<{[]{}}[{}{})>([{}{}](<>{})))([({}
<[(<{({<([<[{<(){}><<>[]>}{[[][]]<[][]>}]{<([]{}){[]<>}>}><[[<<>{}><{}[]>]]{<<()<>>{<>()}>({{}<>}<<>[]>)}
<[({({[{[<<{<([]())({}())><[()[]](<>{})>}>{{[(<>{})({}{})]{[[][]]{()[]}}}<{[<>[]]{<>()}}[{<>()}([][]
((({([<[<{{[<<{}[])[{}{}]>({{}()}{()<>})]{<<{}()><<>()>>(((){}){[]<>})}}([([()()]{<>{}}){({}[])[{}
(<((<([{<(<<{<<>[]>[{}{}]}[{<>}([]<>)]>(<{[]{}}{{}()}><(<>[]){()<>}])>{({[()<>]{<>{}}}[[[]<>]{<><>}]){
<({<[[([<<[(<[()[]]>)({(()())(<>{})})]<(<[{}()]{{}[]}>)>>{[[{<<>()>[<>()]}{([]){<>()}}][<<[][]><(){}
((({<[<[{<(([({}()][<>()]]))[<[[()]<{}<>>]({[]()}(<>[]))>]>(<{{<<><>><()()>}({[]()}([]()))}(<{{}()}((){})>({{
[{<<{(<{{{{[{<()[]>(<>())}](({[]{}}{(){}})<({}())[[]<>]>)}{<{[[][]]>{[()()]<<>()>}>[(<{}[]>[()()]
({[((<{<<[(<[{(){}}([]<>)]<(<>{})(<>())>>{{(<><>)(<>())}[<()><{}{}>]}){{{{<>()}<()()>}{[[]
<[[[{([{((<<({[][]}<()[]>)>><[(<<>{}>((){}))]{[<[]{}>({}<>)]({()[]}(<>{}))}>)<({{([]()){{}{}}}})<({<<>{}>{(
<<({<<[[<((<<{{}()}([]()]><{()<>}<<>()>>>({<<>{}>({}<>)}{<[]<>>[<><>]})))<[[<<<><>><()()>>{<<>{}>}]([<
([<{{<(<{{(<{[[]()][{}<>]}[(<><>)]>)}{({[(<>[]){{}{}}]<{{}{}}[(){}]>})[{({(){}}(<>()>)<[[][]][{}<
<[<[([[<<[([{[()<>]<[]<>>}<{()}[()]>])]<{<[<<>[]>[[]()]]<([][]}{<>[]}>>[<<<>{}>>{<{}[]>({}())}]}<[<<[]<>>><
<{<([[(([{<<[{{}()}[<>()]}>{<[<><>](<>{})><<<>[]>>}>(([{()()}(<>())]<[<>{}]>))}]{{{[([[]<>
[{<({<<[((<{<{{}<>}[[][]]>[[{}()]<()[]>]}>{{{{[][]}<[][]>}{({}<>)[(){}]}}(([[]]{()[]})[[()<>]{
<([(<<(([{{<({<><>}{()}}{{<>()}[{}<>]}>[<({}[])(<><>)><{{}[]}((){})>]}<(<{<>{}}({}())>)>}[{(
[{<(<({[[({({<(){}>[[]{}]}({<><>}[[]{}])){[<<>[]><()>]<[{}()]({})>}}[[({{}[]}<{}[]>]]<{<<>[]>(<><>)
[({{<[[<({<{(({}<>)[()[]]){{<>{}}<()[]>}}{(<<>[]>{<>[]})({<>[]}<()[]>)}>><{(<[()][(){}]>){((<>[]){<><>}
({{[{[{<<{((({(){}}){[<>{}]}))<<<{{}[]}{<>[]}>((()[]))>{{<{}{}><()>}[{{}{}}<<><>>]}>}><[(<[((){}){<>()
<[{<([[<[[[{<[<>[]]({}<>)>[{<>[]}[{}{}]]}<{<<>{}><{}>}[{{}()}[[]{}]]>]([(((){})[()[]])[<(){}><()
({{<<<([[([[<(<>{})([][]>>]]([[(()[]){{}()}]][{<()()>[<>{}]}[{[]{}}((){})]]))(<<{<{}><[]>}(<<>()>({}<>))>[
{<{<<[<(([[[<{[]{}}[{}{}]>]{<<()[]>[(){}]>}]]<({<<()[]>{<>[]}>}{<[{}{}]{<>{}}>{[<>()}}})<<<
(({[<[[{<<<({((){})}[{()}({}[])])>>>{{{({(()<>)[[]<>]}[<[]<>>[{}[]]]){[<()[]>][(<><>)]}}}<(((<[]()
<{[({{{<([{[{{{}<>}}]<<[[]]({}{})>>}[<({[][]}<{}[]>)<{{}[]}>>]])>(((((<{()()}<<>[]>><[(){}][<>{
<<(([<<[[[[({<<><>>[{}]}[{{}[]}{[][]}])][((((){}))[<(){}>])[({()()}[[]()))]]]{{[((<>)[{}{}])({{}[]
<<({<{{(<(({<((){}){[]()}>}){{{[{}()]}{(())<[][]>}}<[[()]](<{}()>{{}{}})>}]><<[({{<>[]}[(){}
([{{<[(<[([<[{{}{}}{<>[]}][(<>[])]>](([[()<>]([]())]((()()){{}[]}))<([()<>]<<><>>){<<>{}>(<>{})}>))<{{{<()[
{[[[[([{[{[{{<<>()><(){}>}({<>()}[{}[]])}([{(){}}<{}{}>]({<>[]}(<>[])))]}({[[[()<>]{[][]}]]}<{<{<>()}
[<(([<<((<(((<[]()>{[]{}})<{()<>}([]{})>))<(([(){}]<[]{}>)<<{}>({}())>)((<{}()>{()<>}){({}{})<(){}>})>>((<<(<
[([[({<([(<((({}()))[{{}<>}{()[]}]){{{{}()}(<>{})}<<{}()>{<>{}}>}>)<([[[{}](<>{})]<[[]()]<<>[]>>]
(({(<<[<{(([((()<>)([]()))])<{(([]<>){()<>})[{{}<>}[{}<>]]}>)({([{<><>}({}())])})}(<([([<>{}])<<<
<(([([{[[{{<[<()>](({}()){<>[]})>[[({}[])]{<()<>>{{}}}]}[<{{[]<>}[[]()]}>]}]](([<<{((){})(<>)}{[()[]][(
({(({<<[{{[{<<()[]>{[]()}>([<><>]<{}>)}<(<{}()>[[]()])[<[]}[()]]>]}}{[{(([()()][{}<>]))}<[([[][]][<>{
{(([({<<[[{<(<[]<>>([]<>)][<<>()>[[]<>]]><{(())[(){}]}<(()[]){{}[]}>>}[<[(<><>)(<>[])]<{[]}>><[[()[]][[]]]((<
{{(<[[({(([[(<{}<>>(()())>{<(){}>{<>{}}}]{[{()[]}{[]{}}]}]<[[[<><>][[]<>]][{{}{}}]]<([{}{}]<<><>>)<
[<<{<(<[([[(<<()<>>([]{})>(<{}<>>{[]<>})){<[<>{}]<[][]>>(<()[]><<><>>)}]<([(<>()){<>{}}](<
([[{{([[([{[<<()<>>[()[]}>[[<>[]](<><>)]][{{{}()}{{}{}}}(<(){}>[{}()])]}]){{{{{((){})[{}<>]}<{{}<>}[[]
[[{(({{{<[(<{(<>())<[]<>>}[([][])]>)][<[({()()}(<>())){[{}<>]<[]()>}]}[[{{(){}}{()()}}]{[{{}{}}[{
({<{<{[<<{({{{{}{}}(<>())}<{[]}<{}{}>>}(([[]{}]([]{}))))}>>]}<{{<({[<([]())>(({}<>)<{}<>>)]}<[<(()()}{{}()}
<<[[<[<[[{({<[<>[]][()()]>{<{}()>{<><>}}}[{([][])<()<>>}<{{}()}([][])>])[{[[{}]({}{})]{{[][]}([][])}}
[({[[[[[[({{{<()<>>}}[[(()())({}[])][{[]{}}[()()]]]}{{{{[]()}<[]>}[[<>[]]<<><>>]}<[<{}<>>(<>)]<{<>{}
{[[([([({{[{<{{}[]}{()[]}>}{({<>()})<<<>{}><{}{})>}][[<[{}{}][()<>]>{[[][]][<>[]]}]{[{()[]}[{}()]]({[]<>
{{[[<{({({[[<<<>{}><{}[]>><([][])(()<>)>]]}<([{[<>]<<>{}>}<[{}[]]([][])>][<({}{}>([]<>)>{[<>{}]}])[
({{[{{(({{<({(<><>)<[]{}>}[[{}[]]<[]{}>])>(([{{}()}{[][]}]{{()()}<{}<>>}){<{{}[]}{{}{}}>{(()())}})
{({<{[<<<{<<<{{}()}[[][]]>{<()>(<>())}>>({[[<>[]]<(){}>]<[[]{}]{<><>}>}<[(()[])<<>[]>][<[]()>]>)}({<
{<{([[<[<{{[[[{}<>]<(){}]][<()>(<>{})]]<<<()[]>[<>[]]>>}}{(<{{[]<>}<<>[]>}(<[]<>>)>([{()()}[[]<>
<<((<<<<{<<{({<>[]}({}<>))}(([<><>]{<>()}>([<>[]][(){}]))>><(({<()[]>}({[]<>}[<>[]]))<({(){}}
[{<({<<<{({[{[[]()]<<>>}{{[]()}[<><>]}]}{(({<><>}<[][]>){({}{})(<>{})})})}{<<({(()())<[]()]})([{<><>}<()<
(<((([(<<<<<{[{}{}][{}{}]}(<<><>>[[]<>])>{<{<>{}}<<>()>><{<>[]}[{}{}]>}>(((<<><>>({}())))([<<>[]>]<<{}()>([]
<[{([<<<{{[<<({}())[<>]>[{[]{}}[()]]>{{[<>{}]{<><>}}<({}[]){()<>}>}]}}[{{({{()()}(()[])}<<[
###

15
input/day/11-example.http Normal file
View File

@@ -0,0 +1,15 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-11
Content-Type: text/plain
5483143223
2745854711
5264556173
6141336146
6357385478
4167524645
2176841721
6882881134
4846848554
5283751526
###

15
input/day/11.http Normal file
View File

@@ -0,0 +1,15 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-11
Content-Type: text/plain
2524255331
1135625881
2838353863
1662312365
6847835825
2185684367
6874212831
5387247811
2255482875
8528557131
###

52
input/day/12-example.http Normal file
View File

@@ -0,0 +1,52 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-12
Content-Type: text/plain
start-A
start-b
A-c
A-b
b-d
A-end
b-end
###
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-12
Content-Type: text/plain
dc-end
HN-start
start-kj
dc-start
dc-HN
LN-dc
HN-end
kj-sa
kj-HN
kj-dc
###
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-12
Content-Type: text/plain
fs-end
he-DX
fs-he
start-DX
pj-DX
end-zg
zg-sl
zg-pj
pj-he
RW-he
fs-DX
pj-RW
zg-RW
start-pj
he-WI
zg-he
pj-fs
start-RW
###

30
input/day/12.http Normal file
View File

@@ -0,0 +1,30 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-12
Content-Type: text/plain
start-kc
pd-NV
start-zw
UI-pd
HK-end
UI-kc
pd-ih
ih-end
start-UI
kc-zw
end-ks
MF-mq
HK-zw
LF-ks
HK-kc
ih-HK
kc-pd
ks-pd
MF-pd
UI-zw
ih-NV
ks-HK
MF-kc
zw-NV
NV-ks
###

26
input/day/13-example.http Normal file
View File

@@ -0,0 +1,26 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-13
Content-Type: text/plain
6,10
0,14
9,10
0,3
10,4
4,11
6,0
6,12
4,1
0,13
10,12
3,4
3,0
8,4
1,10
2,14
8,10
9,0
fold along y=7
fold along x=5
###

1001
input/day/13.http Normal file

File diff suppressed because it is too large Load Diff

23
input/day/14-example.http Normal file
View File

@@ -0,0 +1,23 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-14
Content-Type: text/plain
NNCB
CH -> B
HH -> N
CB -> H
NH -> C
HB -> C
HC -> B
HN -> C
NN -> C
BH -> H
NC -> B
NB -> B
BN -> B
BB -> N
BC -> B
CC -> N
CN -> C
###

107
input/day/14.http Normal file
View File

@@ -0,0 +1,107 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-14
Content-Type: text/plain
CNBPHFBOPCSPKOFNHVKV
CS -> S
FB -> F
VK -> V
HO -> F
SO -> K
FK -> B
VS -> C
PS -> H
HH -> P
KH -> V
PV -> V
CB -> N
BB -> N
HB -> B
HV -> O
NC -> H
NF -> B
HP -> B
HK -> S
SF -> O
ON -> K
VN -> V
SB -> H
SK -> H
VH -> N
KN -> C
CC -> N
BF -> H
SN -> N
KP -> B
FO -> N
KO -> V
BP -> O
OK -> F
HC -> B
NH -> O
SP -> O
OO -> S
VC -> O
PC -> F
VB -> O
FF -> S
BS -> F
KS -> F
OV -> P
NB -> O
CF -> F
SS -> V
KV -> K
FP -> F
KC -> C
PF -> C
OS -> C
PN -> B
OP -> C
FN -> F
OF -> C
NP -> C
CK -> N
BN -> K
BO -> K
OH -> S
BH -> O
SH -> N
CH -> K
PO -> V
CN -> N
BV -> F
FV -> B
VP -> V
FS -> O
NV -> P
PH -> C
HN -> P
VV -> C
NK -> K
CO -> N
NS -> P
VO -> P
CP -> V
OC -> S
PK -> V
NN -> F
SC -> P
BK -> F
BC -> P
FH -> B
OB -> O
FC -> N
PB -> N
VF -> N
PP -> S
HS -> O
HF -> N
KK -> C
KB -> N
SV -> N
KF -> K
CV -> N
NO -> P
###

15
input/day/15-example.http Normal file
View File

@@ -0,0 +1,15 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-15
Content-Type: text/plain
1163751742
1381373672
2136511328
3694931569
7463417111
1319128137
1359912421
3125421639
1293138521
2311944581
###

105
input/day/15.http Normal file
View File

@@ -0,0 +1,105 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-15
Content-Type: text/plain
6763679391685199321216293379889971448824578974299594779321588588854917594121939988499223486918759869
2316279872424397812389627435928425571522864993268981993135231281632931912219714272492398841364337743
2611672912699479934143747711184533124498991233998359921827688713818629591848267212751251782193999574
6912169338419564193119921496213581987492424159798957517399336988989137775762957929689971478512677295
3932311559122894111729688681511182241159886994773792138139838569578133999317372937113824879568115791
8589559297931592498862929729979441917281114429312571991515483885553657942311696693187113914917719999
8215113889897867537369472795288394514311281463548681147471413974111467312128797923211571493578216618
8353591188598582985969267941199579989219858339399879528759128156699712595424919231926423577793888319
7968158785991328349741182178823359987435932199259784623665394822298984991599994974239363919518451979
4719769796126416122596629937853975319746131691284132121869728172317997172141428897895794796191812167
3715796581651751161784761598687561271125699522733481968514817818771137272533379148686393358399562697
8962557499696333687128936247423429275688421766599283984442229598921259494162139235897485497997417698
2182921896724715397151528121721594929388481339121986131936359796235664119251178868889159217485672977
2828391155451888689511271529962927197658791494698163842856727412981821697293253119184773912119989595
9199386341352517771926352819889757985144519361117599547314166929999995972716284565918358465675673988
8722511734918316438427142154119225846521916542121666685543317729394927826333442319376948819282625186
1477775698392989993392219356859976719258173183628158123159842811277192868899697572971451899974811444
8335153624471899974521698617192979799279846783499194279818499779819993698148766775278931949849681136
2269391966932443996719216591454851181957749968945583939554283869612267695171361752994867961193376666
9861712325484181139982862631919269143595262461191729137191664394921995697291311623719788971894557112
3112924177579979863258192877919454273941796893715949583554934558911631754244367342151872134159993285
2979941956219158611766883428493219185525886883611119191938587953596273121943489333147616528786997189
6911351423565397282381124199883475198396389555252699348494149975992869258195112131399297298977795897
9119199355931828419162999986929799583691289619982317919828137147697551391791243988459169917431599811
3848535265995589835498483569499111894179811797988524139731991816798915115719188982418358989615316197
9986394864159675512549196699791852181845314977319988969899439522116944611392429241976152135959496687
1761296827993117963817612129952997912232911828816999868511211229529681228381151777711719891779972859
9849862226991147961391718387156998929941716949984572288291485879679697217224997668438772548619172679
2896199355897526963449291963999361199143143424688187155899714182931423911884487471881515515658192867
8882999928819749128875119614594191789229917398195439659381686259712273461799994165868781999354911927
6293896891611311711917811764936777917992419746299291928141929236699957831472193155131929614221383779
1728911221599715849995857841992339722725816297697995975879639548179113113959417185128498668951991497
6389814779572888297744659943499321785461891927895956813219966863392927311261947592959791194244193985
4712939391449918111131972657951783573919121925419474446716964951423691926889216751829199971929971132
6699393113173611979749359993737683829563992223191989431431991486229753888571121391169999878623437521
1198142461644317844741991158835235118423789877114199729435917618739231152683794599876297129118987729
7111721965894267271711241998912592181993889216116948256156274679111482128896321191168811482813644926
1171113376212775991947216339497719768861872218996599392728399271322997169438555172469628987211141167
4971813199829153127388192731965829199759623126139328216651191296739154191919321549673351715616929225
8119853972258311171879982114156481797449119753397856132264122489141398797971999829792199497347937184
1561927699676538752366853298261467719967474391978893889187186993911227929965998393176697961138881969
3959543274866211216958741199781999369818266285521119327231111949788966823231813299914822949693166178
6854334615997742391438812963442348142383912111514912819499189236198343918618996193813217929982888331
8591288815988159958617116297298498195754511127153431788392191923719497543218299627991945622899279289
1198181911718723715273338822929941917461229991426187431333885549983141594522995949791148288364399931
9892771631174419697317439985991838611951224884481231136571449581393892332789397968799983813949946771
9691923978185936311116748722117898552719939491217617698689477616899284218259911527919573958121194566
1843959822758422286269513881221514742239331123871961146817735961867178733293667759597321611856364687
6977982858241122656318958728139689829747681724996991567112142583112379441312489192619155735979429668
6864883774995893992121211469519696127454667681591441917467229798514197759483539991821689423396931376
3192522673899612494271981219195459514965899598392186194369342687247433627873639189288865189581796451
6193892956996137113415685193111676238918282975948726168585412815746185395326782967392782846445773697
1188865911911546793619591679249496642955219194954776936299621427191849498935988721841952878212961283
8694399699295137671549998897263823738366959893492139427998171551895683249779412599116969296375488479
7877598934985997851215297123318237642987983729213129426654775659332934214699911779979746936272991192
4175196464729659417156311852378196911437496911391319497971434617443518159949999724995188783613191262
3762316191918893118954134928121247287121688294319514979584434758992189222213767189269961981712572193
9981882951928288197367958981851556961646895153776691782279112427148955797179663174911297574899971912
9895926311251443254199633719115569998677994839525436526347578387872641421492919519516711971912127392
9723333996192974279158728199716934988493621698998331467858916957375227137984979938714344915111827182
1489298994798826597544143761492942354121188712292616383251311951685245147566949991744458552776489586
3211451591643914838596299339712994772187111828984686683882184719386899356485897381553187228879431569
3259651629398171558779297578391789196514939231918933422179195617371647233469447869642991783645897982
2189951822939529117192393161419994119171944662568828111311499919463717394995779991162414161719332911
6899749988259797792429961362715358939636711635174199885892389153199229186421823334294179228734911269
1895185897772972825953599619294129599869824625386123522999289881519328792475665963443599326534417127
1422838395994495358964648891923798731481939992848921648929946289995168912914361941528948493335781149
1317917384867191387219277529343126299981599689294419264273884458618911827925925837774616338553561629
8982434966658784238385743322589831393888399172871716379119313128392163811311519839188471992219378467
5395261691648469592639393691332481954629942491921281189152991281859952918822165534198758892953939121
6329251216799321932117288219179141299519462991931239519193384798587198173781939892827679183111344218
3812529999729156619987867616929265585873977681595939647814448735791934148324446952891313111995972677
5282338992996313613159211993928283819929873988655191555399565229817638959377739269398838668781572226
4378531984893973581486991728926841115919613871448996179956749642471991995965911222685526627192999981
5982889739797551811388582535136873719759679761139313976924211474849296399512823999129477342278145322
1218281999719267672993931254981112865424986972187191477949981863168351999531146991641381242421214511
8911997846692872463596818916972951916181657731917916963182871214914196812971788959961183392597197251
4915117978531879932257171943259639189397181298918962191166572986181981965998337591167599159129997195
5161697792393852322887583417693725518643111468281969197221126116117739823199999132753611955461991483
6748848121519929146139951181494977716178656879667787982537212682114283552983879198195439947113885979
8162766788818429134853376715291665789982415877811787277133682815985779596453652213379733961271558178
7126616955919123997999947924157132389218111416139312121275578993825788959911541852194817157964691211
8145196921476116692616113197789995261996944598741116866263325522282139715958136659697393892119667448
9763151993822121312993191662941511916997145299292999193935168979452131598797394513569918623184664781
2292147194129589895647189423118915917258999813964921785795452817643488469847272158199168247483795532
8559629983984149491384859997366788978721291219851118825772145961874767133913997798554453199924989818
1182466299236599621536199516511164491992491155296741794213949818647429481999868811793169519371262165
4738281697798982828461677528585949457922936232449965278919419114997399511378492966791946451772819131
1757396912274429287116228948911154651917537842154149919872599997971951639199787486133851179929798555
1719739825171841761948755899899216798392923289899987521533913487812899954886369899998971639512215499
8791281434118421465514992618674529217949339778941898165388344994151819153515931268975815718393699133
5931698111196917992731929569985187236913914645973813563987549997719875759193672475788621993978779973
1884255199381966237561622788671247184371139285597612245451393421737133245891898958424829971676219425
2583899597668762774732855241679313519878428388682177491132991946939823251369684298843866186992234148
5571952912139441554944189828841898317272294283772779929696126131222992624995317231851888338393316119
8975999266148778637445788139847923481453515261188263961114697957477262989851194731696756118191947696
4382229563773717134612151111919923747618491994839882891451393414319819915995472618861242184413895712
2111697733928869231956532219642919971371939921939182129518341429926954783299694818222137624318218193
7918331918611351816139112921322828652131814891298482791235912154914156276127996537498197874799924122
7836996594939159837193584991869184956399715111271353229592112889346822858939489744779468277719668577
###

48
input/day/16-example.http Normal file
View File

@@ -0,0 +1,48 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-16
Content-Type: text/plain
D2FE28
###
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-16
Content-Type: text/plain
38006F45291200
###
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-16
Content-Type: text/plain
EE00D40C823060
###
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-16
Content-Type: text/plain
8A004A801A8002F478
###
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-16
Content-Type: text/plain
620080001611562C8802118E34
###
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-16
Content-Type: text/plain
C0015000016115A2E0802F182340
###
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-16
Content-Type: text/plain
A0016C880162017C3686B18A3D4780
###

7
input/day/16.http Normal file
View File

@@ -0,0 +1,7 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-16
Content-Type: text/plain
4054460802532B12FEE8B180213B19FA5AA77601C010E4EC2571A9EDFE356C7008E7B141898C1F4E50DA7438C011D005E4F6E727B738FC40180CB3ED802323A8C3FED8C4E8844297D88C578C26008E004373BCA6B1C1C99945423798025800D0CFF7DC199C9094E35980253FB50A00D4C401B87104A0C8002171CE31C41201062C01393AE2F5BCF7B6E969F3C553F2F0A10091F2D719C00CD0401A8FB1C6340803308A0947B30056803361006615C468E4200E47E8411D26697FC3F91740094E164DFA0453F46899015002A6E39F3B9802B800D04A24CC763EDBB4AFF923A96ED4BDC01F87329FA491E08180253A4DE0084C5B7F5B978CC410012F9CFA84C93900A5135BD739835F00540010F8BF1D22A0803706E0A47B3009A587E7D5E4D3A59B4C00E9567300AE791E0DCA3C4A32CDBDC4830056639D57C00D4C401C8791162380021108E26C6D991D10082549218CDC671479A97233D43993D70056663FAC630CB44D2E380592FB93C4F40CA7D1A60FE64348039CE0069E5F565697D59424B92AF246AC065DB01812805AD901552004FDB801E200738016403CC000DD2E0053801E600700091A801ED20065E60071801A800AEB00151316450014388010B86105E13980350423F447200436164688A4001E0488AC90FCDF31074929452E7612B151803A200EC398670E8401B82D04E31880390463446520040A44AA71C25653B6F2FE80124C9FF18EDFCA109275A140289CDF7B3AEEB0C954F4B5FC7CD2623E859726FB6E57DA499EA77B6B68E0401D996D9C4292A881803926FB26232A133598A118023400FA4ADADD5A97CEEC0D37696FC0E6009D002A937B459BDA3CC7FFD65200F2E531581AD80230326E11F52DFAEAAA11DCC01091D8BE0039B296AB9CE5B576130053001529BE38CDF1D22C100509298B9950020B309B3098C002F419100226DC
###

View File

@@ -0,0 +1,6 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-17
Content-Type: text/plain
target area: x=20..30, y=-10..-5
###

6
input/day/17.http Normal file
View File

@@ -0,0 +1,6 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-17
Content-Type: text/plain
target area: x=48..70, y=-189..-148
###

6
input/day/6-example.http Normal file
View File

@@ -0,0 +1,6 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-6
Content-Type: text/plain
3,4,3,1,2
###

6
input/day/6.http Normal file
View File

@@ -0,0 +1,6 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-6
Content-Type: text/plain
3,3,2,1,4,1,1,2,3,1,1,2,1,2,1,1,1,1,1,1,4,1,1,5,2,1,1,2,1,1,1,3,5,1,5,5,1,1,1,1,3,1,1,3,2,1,1,1,1,1,1,4,1,1,1,1,1,1,1,4,1,3,3,1,1,3,1,3,1,2,1,3,1,1,4,1,2,4,4,5,1,1,1,1,1,1,4,1,5,1,1,5,1,1,3,3,1,3,2,5,2,4,1,4,1,2,4,5,1,1,5,1,1,1,4,1,1,5,2,1,1,5,1,1,1,5,1,1,1,1,1,3,1,5,3,2,1,1,2,2,1,2,1,1,5,1,1,4,5,1,4,3,1,1,1,1,1,1,5,1,1,1,5,2,1,1,1,5,1,1,1,4,4,2,1,1,1,1,1,1,1,3,1,1,4,4,1,4,1,1,5,3,1,1,1,5,2,2,4,2,1,1,3,1,5,5,1,1,1,4,1,5,1,1,1,4,3,3,3,1,3,1,5,1,4,2,1,1,5,1,1,1,5,5,1,1,2,1,1,1,3,1,1,1,2,3,1,2,2,3,1,3,1,1,4,1,1,2,1,1,1,1,3,5,1,1,2,1,1,1,4,1,1,1,1,1,2,4,1,1,5,3,1,1,1,2,2,2,1,5,1,3,5,3,1,1,4,1,1,4
###

6
input/day/7-example.http Normal file
View File

@@ -0,0 +1,6 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-7
Content-Type: text/plain
16,1,2,0,4,2,7,1,2,14
###

6
input/day/7.http Normal file
View File

@@ -0,0 +1,6 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-7
Content-Type: text/plain
1101,1,29,67,1102,0,1,65,1008,65,35,66,1005,66,28,1,67,65,20,4,0,1001,65,1,65,1106,0,8,99,35,67,101,99,105,32,110,39,101,115,116,32,112,97,115,32,117,110,101,32,105,110,116,99,111,100,101,32,112,114,111,103,114,97,109,10,322,659,689,304,1706,69,576,110,238,904,299,206,78,954,776,590,404,125,235,438,472,187,205,620,14,378,1056,496,1323,59,44,636,432,658,30,195,107,425,105,214,908,145,641,1467,441,346,455,1454,773,146,97,42,509,8,1217,503,901,1147,1654,45,1438,503,62,851,590,105,217,44,646,197,491,333,1224,90,262,1132,1499,864,128,165,36,646,422,1265,501,414,328,170,1566,115,1049,154,224,490,1018,1019,1484,315,614,816,207,240,423,132,196,484,532,857,341,723,69,294,787,1020,691,185,525,697,1435,62,156,21,314,489,640,93,415,446,902,15,510,91,104,317,971,108,187,616,794,416,1332,499,1086,443,514,258,383,162,1034,1,331,269,283,1835,150,1698,1020,318,1540,687,17,889,585,1682,67,547,1,1353,149,1650,145,13,151,1144,409,294,740,676,267,827,1624,804,44,795,297,265,426,508,11,1359,963,277,203,1093,450,1229,287,160,1913,914,512,1098,103,975,64,26,787,87,104,340,362,153,173,93,455,89,577,40,1459,320,398,1245,12,452,515,594,0,1497,1238,88,14,538,431,0,699,1033,483,574,593,612,770,1006,332,23,753,1334,536,109,164,250,86,333,1577,896,1199,521,73,467,1037,0,539,375,1243,238,301,262,191,415,88,515,1410,54,1019,934,81,1273,78,306,57,145,472,57,682,203,63,512,427,104,457,214,197,1766,350,355,536,839,7,586,1209,71,88,858,562,64,335,84,1161,1305,1203,102,52,193,47,852,718,885,146,111,1014,667,8,52,637,254,1453,674,1542,47,107,55,321,591,829,1113,40,215,398,254,327,181,200,20,129,265,109,705,1265,12,148,367,349,333,341,272,90,166,699,681,1927,1267,86,282,299,36,48,1594,110,645,569,724,199,334,239,117,448,108,67,1257,142,902,208,728,700,107,1,621,1036,1397,837,313,380,208,156,39,220,238,648,197,26,2,1010,98,458,271,1237,99,751,31,236,26,622,802,4,121,244,240,67,462,1181,100,1381,1494,446,23,35,95,357,212,90,820,56,96,171,11,1101,1020,149,125,1504,896,25,8,1704,193,421,134,135,1397,1052,1059,741,967,1537,373,585,279,46,398,654,305,435,89,11,702,27,102,573,497,139,530,805,3,122,1329,175,134,137,57,516,790,587,163,296,153,1124,1336,946,63,39,278,13,253,237,653,200,250,1067,1891,697,182,628,0,60,303,389,1821,189,295,41,619,71,795,1228,110,1198,306,941,59,72,666,610,850,984,564,330,636,111,1541,542,80,212,927,127,427,33,365,313,697,200,286,708,478,264,448,1159,256,28,273,7,238,176,956,735,264,361,1882,139,1345,1,271,508,0,190,110,119,76,715,1338,80,1026,132,286,966,337,1715,514,328,265,63,1376,1413,1421,457,66,1594,737,59,548,184,801,165,96,129,1200,50,604,1013,309,627,625,597,1012,77,670,177,264,115,174,109,148,270,24,346,33,1270,359,954,113,207,484,1756,1155,1067,991,1358,61,530,612,135,351,706,244,489,609,484,76,168,258,161,694,1019,1502,558,117,112,1041,1040,448,879,37,616,930,32,357,1650,231,458,1068,585,9,439,412,292,116,494,246,28,260,463,200,84,1106,750,667,1284,129,878,1077,453,960,409,1327,412,243,89,616,443,256,645,1083,526,95,818,9,59,76,541,312,1168,430,64,2,187,561,1322,369,1245,64,854,126,359,240,42,157,35,232,863,74,331,250,695,914,182,208,94,656,87,530,1444,163,429,46,299,1038,38,471,91,112,819,1644,244,1718,76,806,103,752,124,796,1183,15,829,1038,6,529,913,140,326,435,44,617,659,123,753,444,467,408,182,1387,202,684,60,55,26,155,902,1075,86,375,924,862,150,1230,700,143,417,156,933,872,639,1032,137,146,1649,1562,4,11,257,556,29,1440,177,935,741,492,300,1530,92,453,56,244,37,997,762,624,456,1182,845,150,367,393,334,338,100,278,1374,267,1261,25,106,332,25,2,14,123,288,600,880,838,323,183,1075,202,445,218,1538,73,300,555,322,587,7,606,753,676,28,57,557,1283,23,73,31,370,29,491,5,31,97,199,188,1088,276,1061,1043,42,1463,601,56,255,426,150,1451,562,0,408,7,701,111,1145,838,976,310,561,645,33,213,1020,73,81,849,2,586,825,183,2,704,59,1515,906,647,91,585,14,778,333,258,353,128,839,146,81,231,128,716,699,64,345,812,906,1180,286,243,295,1031,197,1392
###

15
input/day/8-example.http Normal file
View File

@@ -0,0 +1,15 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-8
Content-Type: text/plain
be cfbegad cbdgef fgaecd cgeb fdcge agebfd fecdb fabcd edb | fdgacbe cefdb cefbgd gcbe
edbfga begcd cbg gc gcadebf fbgde acbgfd abcde gfcbed gfec | fcgedb cgb dgebacf gc
fgaebd cg bdaec gdafb agbcfd gdcbef bgcad gfac gcb cdgabef | cg cg fdcagb cbg
fbegcd cbd adcefb dageb afcb bc aefdc ecdab fgdeca fcdbega | efabcd cedba gadfec cb
aecbfdg fbg gf bafeg dbefa fcge gcbea fcaegb dgceab fcbdga | gecf egdcabf bgf bfgea
fgeab ca afcebg bdacfeg cfaedg gcfdb baec bfadeg bafgc acf | gebdcfa ecba ca fadegcb
dbcfg fgd bdegcaf fgec aegbdf ecdfab fbedc dacgb gdcebf gf | cefg dcbef fcge gbcadfe
bdfegc cbegaf gecbf dfcage bdacg ed bedf ced adcbefg gebcd | ed bcgafe cdgba cbgef
egadfb cdbfeg cegd fecab cgb gbdefca cg fgcdab egfdb bfceg | gbdfcae bgc cg cgb
gcafb gcf dcaebfg ecagb gf abcdeg gaef cafbge fdbac fegbdc | fgae cfgab fg bagce
###

205
input/day/8.http Normal file
View File

@@ -0,0 +1,205 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-8
Content-Type: text/plain
gfeabcd adecfb gcedb cef efgdc decabg cbfg edfga fdegcb cf | fc faedg fdage fec
bcfegd fdceg ecgfadb fdae af cdeagf afc abdgc gcadf gfbace | cefdbg afgedc bcagd gedcf
gbf bagdec fgdbae cfbd bgacd fb fbcaegd dfgbac gbfca gecaf | gadcfb abgcf bdcgea gbf
eagcf cdgbaf cbadg fbcdgea cebfad fb fdgb abf gcdbea cgabf | bfdg dgacb gacef bafcg
bgface cfadb gfc gcfba febg aedcgfb bceag cdgaeb adfecg gf | acfdb fabdc efagdc facbd
bfegac adbfg ebagf beafgcd gfeadc age cgedbf gfceb eabc ae | acbe gfcbea aefgb abdgf
bfeag cbae cbg bc cbaefg cfdga fgdbec ebadgf eacgfdb gabcf | bfgcea eabc eagfb bc
abdcfg aebfd fbcade cdbge cfae eafcgbd dcabe bca degfba ca | ecfa fcadegb edbfag abc
dfcgea efcbg ecda fadgbc fac bdacegf ac feabgd afgde ceagf | fdgae abgdfc egcfa fagde
gfd gdcab fgdcae ecdfb bfdgc dacbef fbeg fg fdcgbe cdagbfe | bacgd cfdbea efacdg bcaefd
eb afbgd gafbe bef gacdfb gdecfab aecfg egdb defgab bdaefc | gacfbd bfaecd gabfdc bef
ecfb cbdfeg fgbadec fgcdb egf cefdg eagdc fbcdag fe gadbfe | fbgade bedfag gafbdc ecfdg
bafcdg gbd dbcgef ecgdf cbged cgabe faebgcd cgfeda db debf | bdg efdgc fbed gbcde
gdfceab afced decafb gadfc fg agdbc befcga fegd cgf cfegad | egdf ecafbg gbcda dcagf
eca ea efda cfbda badgcf dbcea edcfab abfcdeg bagfce cbdeg | efad fedcba fgcbea adfbce
gdefbca cf acbfg cegbda begca fbc gfebac afce gbdfa bdfgec | cbf bfc gecbaf cbafg
afcebd agebfc fbcea eadfbg bdf cdfa dfecb df cbdfgea becgd | ceagbf fcda becfd ebfac
ecb adgfeb fedbgca efac cfdegb egbaf ec bgcda gefbca cgaeb | afbdgce bec ec feca
eacdb dfcabe dg fdabgc cdg gaed cbaged gecdb ebgcf dagefbc | debgc dgaceb gcd fdebca
cega gdbefac gfdcb efbgca ga afg cgbaf aecfb ceabdf edgbaf | fedagb dbafce ga ga
efbadc acgde fagcde fe dcaebg edfg acgef cbagf fae acfebgd | ef badcef dfge gecfa
cbgfa cbae dabgef ba bag fcgea fdcage gfbcd cgbdaef gfecab | aefbgd bfgac gebacf bgfac
dgfbce fgc bfcda egdfa gc fgedab acgdf acedgf aegc fbcgade | dfagc bgdafe aegfd egfda
dgfa bedfc badcf agfbcd af eadbcg bfegca bfa cgabdef bgadc | bgdacf dcfba fcbda gbedafc
aceg gdaef fcbegda dcefab afcedg abgdfc cadef agf degbf ag | bdgfe bacfgd cadfe fcgeabd
bgefcd edg acdegb edcba cbdefa cfaeg beacgfd egcda dg dbga | efagc abcdegf adfceb dg
faedbc gabde becfgd caebf acfg eacbg cgabfe cdebfga gc gcb | cdgebf cefab abdfce gdcefb
de cgdfb edbg dbacfge cdfeg cebdgf agcef afbcgd dce dbfcea | beadfgc gbcadf dgcef degb
egcafb cgadfbe gdace fd bafce cedabf bgdefa dcfb afd ecafd | gaefbd dfcb aebcf gcabfe
cb beafcd bdgacf cdb bgac edgbfac cgfed bcgfd bgfdae gdabf | bafdg gcba fbgcd cegdf
fceba ag degafbc bfcga bcafeg agf bafedc gace bfdcg fedbga | bdefca fcgbd cbafe cgbdf
cafbge ce fbcea fecgdab aec adbcgf fbgca bgec baedf fegdca | defab bcfae ecgb aec
dgbc dagfcb acfgbde bad adcfg dabfc gacdef aebdgf cabef bd | acfdb defgca dbegfac gfdca
ecdf degfb adbge fcbgea dbgfec gfd df egfcb gacdebf cdfgba | cgbdfe gfd cfegab gfabce
defcbga fcade efbac fb gacdbe abceg abcdgf egbf fcbgae bfa | befg cabdge eafcb bf
cfbdae cg decbfag egfab fgdc dcbfe fegbc gce gdebca bfdgec | dcfg eadgcb ebdfc gfdcbe
eagcdf cfaeg dgfe bdcefa gcabfed cgbda cegfab dae cagde de | dae adbecf edfcga fdge
egfa gfbeac cfbag af fcgbe egbdfc abf cgbda ebfadc gbaedfc | cagefb edcbgf gebfc egcfb
gda ga bcadge gfea dcbgef adcfb fdebg cgbfdae gfdaeb fabdg | fegbd egaf dafgeb gda
gefad fegbad adecbfg db bed eacgb fcdgeb agdbe adbf acgfde | fabedcg bed gfadeb gedafc
fb cbefa baf dfbgca edfac gefbac eadbgc efbg gfecbad aecgb | dbacfeg degabc fgacbed febg
cbgfad eabcfgd cfdeg fbd adegb fb cfeb egbcfd fbegd agdefc | fdaegc febc fb ebgad
dbfgc badc cfdabg fgaceb degfab facegdb dgb efgcd fcagb db | gfbca cgfbd gacfbed fbgdc
efgcbd efbdc ef febdag dagfbc fcge bfdcg dabcefg edf ecdba | cbdegf defabg dcgabf bcade
ecdfbga cbdeaf bfgdc fca eagdfc eafdb bdfca ca caeb gfeadb | cbae dcbfa acf fgcbd
gdefcba bafd efcdab gecdbf fdc becfa gceda fd cafde baecgf | dfaec cabedf abcfeg df
cfb daefb bgfcde dgacb edfcagb acfe fdbcea dcafb cf febagd | fecdba dfcageb fabcd ceaf
adgbec fcgb badgecf dagcb bagefd fdb bf dcbfa bfadgc cfdea | fb efdac cfdba gadcb
afcgd bac gdebfca bcgaed afbcd ecdfgb dcfbe ba befa eafdbc | dcgfa dgbfce ab afcbed
gbcdaf fdgac bagde cgdbaef eabgcf bf gecdfa gbafd cdfb fgb | aecgdf bdega gafebcd aefgbc
gfeb cadfg bdfga aefgdb bgd bagdcfe bgeacd gb cebdfa efbda | dafebc bfadge dgb adcfg
cda dageb fgebda bfcdage dcbeag cgade cefbad ca cbga cfdge | gbadec febcad beadg cfbdea
gdabf eadgf fe defagcb abef feg gabcdf cedag dafgbe edgcbf | abgfde gedafcb cgeda adgec
fbd gfeba fgecad edafgbc dfcbga abdgf cadfg cgdb bd aecfbd | agfcbd ebacfd bafdg dagcf
cadefb cgde eg aebfcg fdbagce afdceg fbagd aeg dfage aedfc | gdaef fedca eg ecabdf
dgbeaf fcbdga ae agfcd egabdcf deac dcgfae acgfe fbceg gea | aecd dace gcbfe gcfea
dafeg fcg degbac gcdbe dcgef bdegcf gedbcfa cf ebfacg bcfd | agfebdc cegdf cf cf
bdfcea bdgae ecbga dbg fegbda bdefa dg dbacgf geafbdc efgd | bdg gefd cagbe debga
aegfdb afcbd cdaebfg dgafbc cagb ba dcefb fba cdagf fgadec | fedcb acbg bfcdga gfcaed
bfagcd agfb afcdg fcegadb dfgecb gb adbec gabdc efacgd gbd | eacbd adcfg fbgadc dbgca
fcedg dfgbea ea fcbadeg ade agefdc afcdb egca ceadf fegcdb | dfgce efcgdb dgecbf cfabd
dfea ed agdfebc eabfc bcdgfe edc cdbga ecbda aefdbc acfgeb | bdaec abfec gbedcf acbde
dgefcb fbcaeg fbcga bgfcaed bfgda dcbfag fgd cfda edbga fd | bgcfae abgdf acfgbe abegd
dgabfc cgdfe afd fdcae af agfe decba fcebdg dgfcbea dgfcae | fcaed fcabdg eafg fa
gafce debca gdfeca dfag dacbfeg fcbedg ceagbf fdc fd cadef | ecfad gcbefa begacf edbcgf
daceg efdcbg fcgad dbeca bdface bcfagde abge ged aecgdb ge | ecgdbf egcad eg aebg
fdbace debagc cgbef degba bacfedg gfda afb edfgba gbefa fa | fbdgcea befacd cdaebg fbaegd
fgbdea dg gdfb gfcebad abfeg afecgb dagbe edcgfa cdeba edg | egd fbgd dge eacdb
ge agdcfb fdcag fcbgaed degcf eadg bdcef acefdg bcfaeg gfe | aecfdg eg dcgfa caegbf
bcgef gfdb bgfcae fcadbge cedbg edafcg dg dcebgf bacde dge | agefbc bgefcd bedfcg dg
fga ga dcgfb dgeabf beadfgc eadfc gbca dcagf fadcbg bcgfed | ga dgcfba agcdf befcdg
dbag cafgbe cdfgaeb gabcde eabdc fdace bd bgcea gdecbf bcd | afdec abegfc gebacf edgabc
fcde cbadefg gdcefb bcdagf bcgef fdg abgcef edbfg df eabgd | egabd dbega gfcadb dbega
bfdag adbefc efdgcb fceab dbc cfdba egafbc dc ceda beacdfg | dbfcge cd fbcea efacb
dgaeb cgbeadf afbeg gdbfae ebadcg gdfb acgedf fg abefc gaf | fcdgbae gf bgaed fbaedg
cfdbeg dcfaeb cagbe cfgabde afdc fbaed cfe bfaec bgadef fc | fcaedb gbeac cfdgbe afdc
ceg dgecfa abecfg agcdfbe gcdae gfdcab fdec gbead ce acfdg | cgfad fgebca adbfgc dagcf
dcf cgebfa dc gdcaef eacgbdf cdefgb cebd dagfb cdgbf cfgeb | cd bgadf dbfga dgfba
gebac caefd bf bgacedf ebfdgc dbaf cfb bfeca agcedf dbcfae | debgcf adcefb befgdc gaecfd
abec bafgc fcebg fbaceg dcefgba degfb gec acdfeg ec fgdbca | dbgfe gdbfe ecgbf bcea
egafbd egdbc bdc cbfdag fcde ecbdfg fgbde ebcag debgafc dc | cdbeg fabedgc fgdecba dc
ecdgfa ag badcegf gaecb eabgfc adecbf cag acebf fbag dbceg | ebgac bfag dgacef edgacf
afgeb adgcbe efdb fgeacbd ceagf gbdefa eb bea dacfbg dabgf | eab bgfdea abfge bdfcage
egbdac aefdb fgdeb dabfc ea dae dbacfeg cagbdf caef eabdfc | cadbf ae dafcgb beadf
egcadbf gbce debac dge adfebc ecgad gdcfa dgcbea gdafeb eg | dgbfae ge adcegb bdfega
fecag dc fgecd dgcb edc fbedca dbcfeg gbedaf gfdbcae ebgfd | dce gbdc edgbfc fedcba
cafebdg adcfge debfac dgcae gec fbdegc ge cgdab faeg ceafd | gafe bagcd edfac cbagfde
dc bgcaf gdcebaf ecgdab cagdf efabcg dgc dcfb fgeda cgbafd | gbcfea dacebg bgfdcea dc
afedc ebfcg dgfbac adbe eafbdcg fdbce bd fbd bdafec afcdge | baed cfgade becdf dbcfea
bdae fbdac deafcb badcegf bcefga badfgc efcgd eb dcebf ecb | bcafdeg eagfcb dcbfag fcdbga
gb dafbce feagd bdegf bdcgafe fdgebc acdgbf cfbde ebcg bgd | adgfcb cgeb bceg dgbcfe
cbdfge bdceag fc edbgc dgfae bcdf fce bcefdga dgefc ebgafc | cdfge bgecaf fdgce cf
ba fcgae gecbfd cefbd cba afdbce aecfb beda fagdcb facdbge | ebad ecagf ba deab
ba baf ebacgf fcgad fbcdeg bgcef gadbecf ecfadb acbgf geab | cgdbfe ba dbceaf adbecf
cdfga efd efagcb egbd ed gacedfb fbdeca decgf gbcef gfbdce | cfedg bedcfg gecbf gbfce
fegbca ega egfdca gfeba afbec fadbg defacb gcbe eg dfagecb | ebacdf bdgeafc dfabg efabc
fdb efcbad bdaeg fbgade gfbe egacfdb adfgc bf dcebag badfg | dfcga bfd adfcg dgbaf
ead agbcd de bcgeda gedb agced cdafgeb bfcgda adefcb fecag | cbgead acdgb edacbf dfeabc
cagdfe egfca geacd dg gbaecf ged agfd cebda edcbgf decafbg | gbaefc ecgaf cgbaef gcfdbe
fd agcfedb adgfb cdaf degab bfacg cebgfa bdgfec fbd dcgbaf | abdgcef dgacbf cfda cedfgba
cafbd fgcb bgcad gdfcba eadbf adecgb cfa efgadc agcdefb cf | fc fdbcag fgeadc fegdca
dgcf eadcg fg dabfe gdefa efg cegabd fadecg gadfbce facbeg | aecbgd gceda gdecab abcgfe
ebfdca agbdcf gfadc bfc afgb cdgaef egcdb gbedfac fb dgbfc | ecbfadg baefdc bf dbgec
fabcge cafged beg abfdge aegdf dabg fgbacde bg fdebg bcfed | efgda dgefba gaefbd bagd
gbfda afbcgd acefdg adb bd gbfae dfcga acegdb acfdegb cbdf | dbfc abd bd dcabfg
ecgdf abcedf gfcdba eadb ecb fdcab fecbagd be eacgbf ebfdc | gdbcfa ecfdab deba efbagc
ca fcda efbdgc ebgda bgefacd cea cdebf bdefca efagbc ebcda | fgebca egabd edcbaf acfd
agebd dcge ed gaebc fegacb cfaebgd bcedfa gfbad dbe cdgeab | dbega fbeacd gaebcd gfcabe
bg edfagb daecgf bgafdce bdeag cgbdaf ebgf ebdac bga edfag | dabcgf cbaed ecdba abg
efdcg afbd bfdeg bgf fgdaecb dagceb fb gcbafe abgdef egbad | fbeagd bcdafge gdbfe fgdbe
becfa fg dgfe dfaegcb cedfbg begdca fgceb facbdg bfg gebcd | fg gebdcf dcbega cdegb
edgacb cb cefdba gcaefd adcbg cdb cbge efgdcab gdeca fadbg | gcabfed cb acgdbe gbafd
cfgbde eagdbc cegdb ebcf bdf fb fbgde facedgb eafdg dcbgfa | cdfagb cfbgde bf dfegcb
gedcfab ebfcda ecdbf gfced fcebdg gcd gdeaf cg cdbgae fgcb | cedafb gdfecb cg gc
fbe edbfca feadbgc cbefga fb dfaeb abdge eacdf gfedac fbdc | fadeb acbedf fbdae daecf
dgacbef efgba dgbfe fecabd bgaefd bde dfcbg de aedg bfgeca | bdfcg ebfdac eagfb gdae
efbgcd aedgcf acd cafbd gbfdaec bagc bcfgd ca gdafcb dbfae | bcadgf beadf ca fgcadb
edgfba fbged aed gadcb bdgae ea efga cdbefa cbefdg dcabgfe | dfbcae bfceda ae gbaed
gdc dfgbeac adcf bfecg abgfd bcdfg dabfgc cd fbgdae dbeacg | gcbfd fdgba afgdcb gbdcae
ca acd ecfbdg fcdeb cdfbea gcabfde afdce cbaf afedg cgadeb | cdbef ca dbecf agfed
gfceab ed fgecd fdgaec gdbfc eacfg cdegfba dcae deabgf efd | eagdfb ed cefag aced
baced dg deabfg dga adcge gcfd acgefd acegf acbdfge fabgce | egfdac becad aebcfgd gcdae
ed dec cdabgf acefb ecbfdga becagd gdbac cedbgf adeg edcab | bdagc acebd bdfgac gdfbcae
gefbca edbfc agdf bgadce fegadc ceagf gafdbce ecfgd dg gcd | gdfaec bfecagd gacefb acgbefd
cdega fcdbga gbfceda gafbde adgcb egfcd ceba dea badecg ae | aebgdc dfbage badfge edgcf
egcdfba ebcga gfe adgcef gdbf bedgaf gabfe dbefa fg cbdfea | gdfaec dfbg abedf gcdfae
feabc gdfeab ebgdafc fa cebga cadgeb gafc fbgeac ebcfd fea | gcabe cbgea febadg fcag
afdb agdfe bdcafge fdaegb aegbd gefdc abdecg aecfbg afe af | fae adfgbe af degab
fdg cdafgb fg cdbef bgfde gfea edbag ebadgc bgaefd adfcegb | befgd dfbgca baedcg gedba
aedgfc afegbcd ag bcedga bedafc aedbc agd gbcda baeg gfcdb | edabc gaeb afedgbc agfdce
eafdc db fcgbe dbac dcbfaeg ecfbad bdf bfced beafgd aedcfg | cdba bd cbafed db
cf fcebgad adfeb afdbce afgcde debgc cbdfe cafb cfd dafgeb | bdecg aegdfc cf dbcegfa
dfceab cebgad fgcbade dae ecdgb bgae dagec fdbgce ea dcagf | eagb ceabdf dcfeab badgce
dgf agcfed gacf afcde dgcef dgaefb efdacb egbdc fg bdeafgc | acdef afgc gdeafcb fdegab
abc aegfcb bc aedgbcf abdce eagdc gdceaf bdfae dcbg aedgbc | fbacge cadgbe gcaedf fdeba
ebdagf ac gcbfe agc aebgc gcbfeda cbdgfa edabg dcae acbdge | cbgfad cag dgfbca abfegd
cdafbge bgf afgd adcebg acefb gf dbgca agdcbf gacfb cfdgeb | dagf dacgb cfabe dbgfce
ebgfacd eafgcd dbcafg ebcafd gdeac afeg eac bcgde afgcd ea | fdbgac dfgca ceafbd gfbacd
gfeb gcdbfea dbecg edacgf fbdac efcdb fbdgec acbedg efc fe | cedbg bcfad ef fec
gfbecad faegb gcdfea cfg gc bceg bagfc fagdeb bacdf fcabeg | aefgcb cfg dafbge agbfdce
bfcedg decba agcf abegfd bdceagf bgacfe cg cbgae efgab ceg | fbceag eabgfc gc abgfec
adebcf agbef abegdc bedgf cfbadeg bedcf fgcd gd bcdfeg gdb | cbafgde dbefc gdb abefg
aeg cdabeg cgfadb aebgd ge ecafgdb edbfa acgdb gafedc gecb | cbge agefdbc cgdafb fdabe
febag ceba ceagf dabfge gce cabedfg cadfg efbcga ec fbdceg | edgcbf bgefa fecag afcgd
faecdb cea dabfgc dfagceb baed dgfcae caebf ebgcf ae bdacf | ae fbaecd ebcgf bcfda
gefc efbdga ec bdgfe fcbeda ecadgbf cbgde cedgbf bce bcgda | ce bec ecdbg gcbad
dbaegcf dbgaf agbde dcebfa gfdc fcabg gcfbda df ceafbg dfb | becdfa dbf egafcb bfagd
gfdae gbfec egcdf afbceg bcdf acgdbfe dabcge cfegbd dc cde | fcdgeb dbagec cafbeg gacebd
fg edcgafb fcadb bdgae fgbda ebdfac fabcgd gecfdb gfd gafc | cefgadb fg cbfged gf
bdfea fceba fc agbce ecdgfab gcefad fec aebdgc bcegfa cfgb | dbfae efc ecbfga gdceaf
cdfgb gefcda abdgce beagd ec bcae dbgfeca ecg ebdgc abfedg | dgabe adgcfe fdcbg ec
fbedc egfabd gadcf dcfeg aecdbgf gcea eg dafgec fcdagb fge | bafedgc eacg ecdfg deafgb
faegdb fdb bgfdec bcgda agfebc gcebdaf cedf gdfcb cfbge fd | dbegacf cfaegb gfcaeb befgac
gbacdfe fdgcba befgc fabe bcf edcbg cgfeab cfaeg fb acdfeg | cfeag bcgde ebaf fgcdab
gef dceg edfbc baedcf bdagef eg cfegb bfacg afgbced decfbg | dfegba cfegdb eg gacfb
cba adgcfeb abfdce dgecbf ca ebdacg becdf adfc fbeac fabge | fbaeg gfbceda fceba bdaecf
cb adefc egcb abc bedgac ecdab bdfgca eabgcfd edagb dabfge | bfdega fagcbd abcde agdeb
dgfbae efgbacd gcdf bdg gd bcgdfe bgcde bedac cgbefa bcgfe | gbd aedcb ecfbg ecdbg
gcafedb ecdbfa fedcg dcefga dfgca gbcde gfae ef fec bdfcga | fdgcabe cbadef fcgda ebdgc
eca ea fbadec debcg agef edcga caedgbf fadgc dgafec cfbgda | cbdeg cedgbaf aecdfb dcgea
afc gbafec egbdfca ca eagbfd aecgf abfeg gcba abedfc dfgec | gafbe cedafb afbeg cagfe
agbde eabcgd fe dcfgb efd becdgfa dfageb fdebg fdcage bfea | def edgfb acfedg bgead
gbdec facbgd ag gba bgceda aedcbgf eagd cgabe bface fbdecg | eagbc gcbdfa bafcgde eacbf
dbacfge cagfdb geba cefgda bgc eacgf caebfg cbdef bg fcbge | bg abcegf efgca cfdeb
gaefc cgefdab fdcaeg aegfdb gb badfc gbf bcfag gbfeac gceb | bdafc aefgdb gfcae dfcab
dbceg bcafgd cfabde cfabdge aed ae deacb face egfbda bfdac | cgabdf fgeadb ade dcbge
dfbgcea fbeca cefbg dfgc bgaefd dbecga gfe fg efdgcb cdbge | gcbfed cfbeg gdfecba gecbd
gaced bd edfcag aecdfgb bgad edcbg debfca deagbc bdc egfbc | bdc cdb efcbad dagb
egfca bgea adebfc gfceab cfebg cdefag dgfbc bgadecf ceb eb | dcefag facgeb edbfca eacfg
fged bcaeg fcgbde gdfacb fcadbe bfcge ebfcd fcg edabgcf gf | gfbdac efcdb gfceb fgdceb
fgbdeac facdb agcf fc bfegcd bedfa gbcda bcdfga fcb degacb | bgecad cf dcgbfea gfca
dafbgc cfdga dgafeb db cfdage bcfaedg fbgec bdf dcab cdbgf | cfdgb befadg ebgfc acdbfg
eadgf gdefab ebacd fc eafgcd caf deafc egcf dacbegf bfdagc | egadcfb agfdcb debca fdcagb
dgaecb efd gbecdf fgdcae geaf faecd dfcab bcfagde egcda ef | fe ecagd efd fed
dbaf bf bfg ebfcga degba cedfg adfcgeb edgfb begafd daecbg | cbegda cbeadg fbg cgfde
gdebcfa cbfad ecgfd fbeg dgfbc bg gfcade gdb gdbecf gdbeac | fdcgbe begf acgedb cbdfg
acfdge cadgbf gecfd dbefc fg agcebfd cfg gedac adcbge efag | egaf cbdgeaf gfc bdfgca
fbgad eabg bcdafg bde edcfab fdgec degbfca badgfe dbgfe be | egbdf bgadf bfdge edgfc
gfceab acf ceafbd cagdbe bdaf dcfae af febacgd fgdec daebc | cegfd dacfbe faebcd adfecb
bgefcda facgb bcg fgec cgebad gc efagcb bdgaf fecba dcfbea | bfeac acgfb ebcaf bgadf
eagbd abcgde afedc gcbe bac debcafg bgacdf bc dbcae gadbef | cba adcfbeg efdac cb
fbead gdebfa cabge adfbgce dcb dc aebdc dacfeb dcfa gbfecd | decfba cd dc edcgfb
gcbae ecfbag gebcf edabg efagcd cga ac beagcdf bcfgde fbac | fgecb gdabe agc ca
dfgacb fadbg afebdg acbgefd gdbc cgafd efgac cd beafcd fdc | daebfgc cebfad bgdeaf dcf
cfdeab efgadc cfbag ef cagbed dbcea ecfab cfe befd gecdfab | fgecdba cabde abefc dbcae
fadec cbgade acbfe df cdf acfdeg afdg gabcfed acged bfdcge | efcda ebfca ebgcfad dcage
cdfgeb eabgcdf faegc facgbd gdc efbdac fdbca fdgca gd badg | dfbceg cfdba cfgda bcadf
cdeafg ecfbgd cb eabc aegdcfb cdfba bfc cdfeba edfac dagbf | ceafdg feadc fbegdc beacdfg
acfbde agc cabgf cfdba gfecb bgadce bcgfda fadg cebdgfa ag | cbfad cebfagd agdcbf dcabf
dfeag fgbedca dfceg fcgaed egdcfb edbcga aefc gfadb aeg ae | gefda gabfd egacdf dfbgec
gfbec bdcaegf cdb bdacgf dgcbae gdcaf cfdage bd badf dbfcg | gaedbc dcb fcgdb afdbgc
cgdef geafc fd fdgbac degbc dgcefba cfeabg dfae cafdge dcf | egbcfa defa df dcf
cafed gdbfa cbfade cfgead cb gecbfd gdbcfea bcea cfb bacfd | bcea afdbg cbegdfa afdcbge
ac fcdgeba gdfec bdgefa fedab eac fadce aecbgf dbac aedcfb | efgabdc cafde bacefd cfeagb
begcf eagcdbf cfg bdcfea bfeca cfdagb bfged caeg cg acfegb | bgfde dgafceb dcfeab dgacfb
gbdfca fadbg fbc cb bdfgae abgcf feacg dfabceg dabc cfgdeb | cbf fcgdeb eafgc bdfgea
fcaegbd abgdce fdcgab gf bfgcae bfg gbfea abgce fgce ebadf | fdabgc gcfabe aebgdfc gbdcae
cdagbe gedbacf efbcad ebdag be gbcfad gbdac ebcg ebd egfda | efgda ecgb gbecda bdfgca
bfdgac gdecb abcde daefc efbgcd ecdbga agbe dab ab cfgabde | ebga ab cgbfad eacdb
efgda ac acf dfgbec dfeac edfbc ecfdgba fceabd bfdcga aecb | ecadfgb abcedf cefad cabe
###

10
input/day/9-example.http Normal file
View File

@@ -0,0 +1,10 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-9
Content-Type: text/plain
2199943210
3987894921
9856789892
8767896789
9899965678
###

105
input/day/9.http Normal file
View File

@@ -0,0 +1,105 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-9
Content-Type: text/plain
0197653456789987679545987978921245689901497654212455689767899878999979653246892123569876467899212346
9989542349899986578959976557890134599892398943201234678956789467989867932135789012398764345678923456
8679931298999765459898765445921247987689459865432345889345892399876546899013894123459976569799634577
6567895497998764345789543239895456797535967976545467891234989989865434598954993248969987678999545798
8456897986539975234568955398789967998212899597676578910395678979996423987895789356798698799997656789
7357899765624987356979967997678899876323795498789789929989989968989219876789998767986569899998867899
6479998654012998487899879886456799985434589349899897898879899757878929865699989878987461939879878989
7989876532129876598967998754347899876545679299965945977569798436569197654389876989986320129865989778
8995987644234998679459899975456943987656798989654326965497656424459298796578965699875431234979998568
9424987654346789789348789986567892398767987878943219876989843212348999887679873579987549345698976457
5313598789556999893245679987679921299899656667894398989878964301237899998995432123597698996987665376
2102459898967898987656799998789992989998943456789497898957896324356789449789521012398987989976554245
3213456997998967899878978969899789978997432347899986787545697534458891234689942123789976879876432156
4323569876899756799989569956987698766986421566789995631234789947669910123799893454569895366999943018
5444567985679534789991349899996569645977310145679864320123456898978954394569789965698789245987894236
6565979874599323567890198798989459759864321236799998432335679999989796989998679796987679123976789345
8989898765678901378932987567868969898765462347899876543479895695395689879876534599876568999435899456
9998719876789323489649876476457890949976574456789987687568996989987899965432123489985389987645998767
2987624989898754599656975324348991234989675778892399898978989878998999996542014678976498998757899898
1298545699999865987999764210235689946798776799999567999989879767899998987843124789998567899969999919
0987656789989986976889754321347999899989987898898998999997665456789987698764434999987689921399989101
1398777899874197975678965432456789678976898987686889989876556345999876549978556789998995439978976992
2349889999963098984568977949767894569865789997575679764986433235794989998989678997899986598867895889
9456992198742129799679989898979913598754657896434768992096520145693199877898789245999999987656954678
8967921098653245698789998767892102987653235789123456789989321238789098965459890129878998654347893557
7898943459854756999895987658943213498732126789012567999878932456896987654323991298765579543238912345
6799854598769867899954398769654324596543245899923456898969896577945698763212679987573498764369543467
5679767699989998999863239878965735987654376799899767987756797689434997853101598765432349878456976568
3568979987899769998943143989876896798765797895798979765645989995319876543213459898543556997567898679
2389998976598643987521012398997997999897898954687997654236978894201998765325578987656789698689998789
3567897895498656799432123567898998988999969543456789894399769799213459876736789998967896569799999894
7678976789329767987993544679999999976987654312398999975987654568924599987858998999989999678998989943
8799235699901989876789795889989988665398979103456789989999543457895987698969987894595698999987867932
9890123988892398965678976999869876543239898919767896799988651367939876459878976943203497899876756891
9921299876793987834779998998754989654198787998998924999977520179923984369989645894312986789765347799
7549987975899875324567999989965999965987676797899212398765421467899865458999786797324975678963235678
8998975986921965434678999878899899878986555656899404459875432348954986567899897896439864567942124579
9397654599899876645889889756789789989299434346798912346986545699843298789921998999598963878921023459
3298943498765987856795679847679678990198621234567895487987659789765109899910139998997654989542434678
9099894598654398967894599934533467799986532345998987579298767999953212999891239997549765698656547789
8989789999763219878962378921012345678987543456789598690129899459895629989789398876839876789767656896
7677679899972102989754569532133469789098658597999439789436943245789798765679987654324987999898867997
8564576789989743499895678943544678993129867998998929896545692134567999954399999976786798956999999898
6432345894398654899998789654665689943248978969987899987657789029989898899498763987997899235689988789
4321434899298776789359898765887799894356989653656789898767892198898756798979942199998989957899975678
5210123678929898995498979876798988789987996542345896789878954987668645987668893267999777898998654589
7491234579012999976987567987899576699999876431556965432999979876557539875456789346789656899998785699
8989955689129899897896456798954324598999765432369994321023498767432129654321239997894347912989898789
9979896793298766798989399899765945987899976545498789432344987654321098768732997899965456899876989899
8765799975987654899878989939879869876789899876987687993656798765534129879549876799989567899765674999
7654567899998432398765779019989998765456798987899456789767929876656434999656965689997698969874323478
8652089998998657989874568998999879876789897798998767898979213987767849878969854569998789754985412567
7643578997899869876543457897998765998995965679349879937698923998878997667898773237899997642195423456
8654689976879878988764598976899654959123987890199995326457899879989986456899632126789999654987689587
9869789865767989899875789655698969843234899989987654215345989768999965345798543234567898767998789678
7989897654656798797976789434987998764345678978998754301234569654569874237997656346678999898959898789
5496987643235897656987894324996889875456789867929865456345978943349752146789866457789999929234999893
4345695432124569547898989209875679876568997657813987678456989432198643256789987667899989910126798912
6456789643097697667969679213986789987689598543101299899568996543398764469899999788999876899437987893
7767998764989899878954598929987891298795349959212349998699569756459895678978999899998765698948976789
8998939875978999989543987898998992999894239898923598979789459867968998799567987999765984567959865990
9769323989865989995432496787899989799930199796899987869894324989899879899979876898754323678999754891
7653212399754779996531985656799877679321987645678975456965455798799864999899985789543210989988966789
8874309987653656789699764545689954578939998437899986345896596987678972989768994898764439899877899891
9986498767321247899987653434599843467998992123789997956789989876567899767957989959765998765656789910
6598987653210345929876432125987656567897789035679989898899976995459998951345679349879876543234898923
5329998654328456913998521016798767878976578997799878789999895976599987530123489219989998932123567899
6910989865987667899876543223569899989895456789912965689998754698679987621238999998994987543234589998
9899878997898898945987956334689991398774346999899754678987543549989986532357898897892198656357678947
5798769898999959321398967456789889987653234987678943789995432125798998754588987646789098765458789435
3987656799986543210179878997995679876543129876567965699864321013457999885678996535899199876768997623
9886545678999654322457989598933598765431098965459899789765532134567892976989987323988989997879789794
8765434567998768473578992349212399979532987653217678999898643246789921987896795439976578998997678989
9876323458999898764679874459323989998754987632104569632987654356896439898945987698765489899989539878
9988434567899999989789765598994978999875698544323689541098765467989597659139898987654346789878910167
9876575878999888999899877987689767891986987698765678932129876579768987543298769499874234679967892345
5987689999998767999910998976598756990197898789879889543234987678957897654369754398765645698856789756
4398794599987656789999999896432646789298989990989997654345798999348998976456963219879896897645679877
3239895989876543498987798754321434567999876421299598766987899621298999986569876323989999982123899998
6345999876987432567975649865410124567899996542998439987898999542456789998998765456899998765236789439
5456899865697643778954234987521234679988889959886724398999997663968997899129976568999899874345689321
6667897654987654567892123498435345898767767898765410279899989789899466789298799789998776965456797452
7979999743598775799954294999545456998656656999874321456789878998791245679989578999886565978967896543
8999898995679896987968989899876569876535345789975432357899869876589387889875465789765434989878999964
9988757989789997896899876789997879854321236789997549456798756982468998998753234898954326499989198895
9876545678992198975798765679998997653210147999989698967898743210178959769942102457893212389991096796
2997626789999019424597654568939298764321256899978987998987654321389543457943212967894345678992985689
1459739899898929013698742379029109885454345998765676899998765434499872129874567898965566989989864578
0296547998767898924797653489198999996965456789653235789999876595578953298765678999899789899876943456
2987656789248567895679854579987689999876787995432123567899987989989875459876789989789898679875432345
3498779893123468976789765678966578899989898954321012345678998979899976569987899876678987598765320156
4999889954564567897899897889656466789999979765432125767889219856789989878999998534567895459876431345
9876998795778678998999998996542345678999865986544234579995439767998799989998996545698954346997532666
8965345696889789129989329986421234899999754397655655678976546978945679999986989676789876234598754598
7844236789994998998778939765410125679989653298786769889999656989234567899975879989893986356798768789
5432125679553456986567799877321236798979790129897878999998987993123458998764567993912995467899989899
6594034689432349987434567986432347897857989245998989988877999899012367899653467892199876878901498967
7689125678944498975412798987685498986546679956789899876456997688975457998762345993987989989892397756
8794234789656987654323689999886579873234567897896797984349876567896569874321235689976492198789976546
9895345998767899875454568923987689764356678998965986543212987678987698765210123498654321013567894324
###