Compare commits

..

21 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
fed31ccb0e [TASK] Finished Day5 2021-12-05 13:33:16 +01:00
bc59bf0ed6 [CLEANUP] Some fixes so that Day4 could be deployed to firebase 2021-12-05 12:30:41 +01:00
f1192091eb [TASK] Implemented Day4 2021-12-05 12:21:45 +01:00
8b3963fa6a [CLEANUP] Code cleanup to reduce the amount of duplicate code each day 2021-12-05 11:25:07 +01:00
54 changed files with 4937 additions and 45 deletions

View File

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

7
functions/src/day.ts Normal file
View File

@@ -0,0 +1,7 @@
interface Day {
part1(input: string[]): number | string;
part2(input: string[]): number | string;
}
export default Day;

View File

@@ -1,6 +1,7 @@
import Day from "./day";
class Day1 { class Day1 implements Day {
static part1(input: string[]): number { part1(input: string[]): number {
const values = input.map(s => parseInt(s)); const values = input.map(s => parseInt(s));
let res = 0; let res = 0;
@@ -10,7 +11,7 @@ class Day1 {
return res; return res;
} }
static part2(input: string[]): number { part2(input: string[]): number {
const values = input.map(s => parseInt(s)); const values = input.map(s => parseInt(s));
let res = 0; let res = 0;

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;

View File

@@ -1,22 +1,23 @@
import Utils from "./utils"; import Utils from "./utils";
import Day from "./day";
class Day2 { class Day2 implements Day {
static part1(input: string[]): number { part1(input: string[]): number {
const forwardMoves = input.filter(s => s.startsWith("forward")) const forwardMoves = input.filter(s => s.startsWith("forward"))
.map(s => this.readUnits(s)); .map(s => Day2.readUnits(s));
const finalForwardPosition = Utils.sum(forwardMoves); const finalForwardPosition = Utils.sum(forwardMoves);
const depthMovesUp = input.filter(s => s.startsWith("up")) const depthMovesUp = input.filter(s => s.startsWith("up"))
.map(s => this.readUnits(s)); .map(s => Day2.readUnits(s));
const depthMovesDown = input.filter(s => s.startsWith("down")) const depthMovesDown = input.filter(s => s.startsWith("down"))
.map(s => this.readUnits(s)); .map(s => Day2.readUnits(s));
const finalDepthPosition = Utils.sum(depthMovesDown) - Utils.sum(depthMovesUp); const finalDepthPosition = Utils.sum(depthMovesDown) - Utils.sum(depthMovesUp);
return finalForwardPosition * finalDepthPosition; return finalForwardPosition * finalDepthPosition;
} }
static part2(input: string[]): number { part2(input: string[]): number {
let depth = 0; let depth = 0;
let aim = 0; let aim = 0;
@@ -24,11 +25,11 @@ class Day2 {
for (const entry of input) { for (const entry of input) {
if (entry.startsWith("up")) { if (entry.startsWith("up")) {
aim -= this.readUnits(entry); aim -= Day2.readUnits(entry);
} else if (entry.startsWith("down")) { } else if (entry.startsWith("down")) {
aim += this.readUnits(entry); aim += Day2.readUnits(entry);
} else if (entry.startsWith("forward")) { } else if (entry.startsWith("forward")) {
const movement = this.readUnits(entry); const movement = Day2.readUnits(entry);
depth += aim * movement; depth += aim * movement;
x += movement; x += movement;
} }

View File

@@ -1,12 +1,13 @@
import Utils from "./utils"; import Utils from "./utils";
import Day from "./day";
class Day3 { class Day3 implements Day {
public static part1(input: string[]): number { public part1(input: string[]): number {
let sums = Utils.zeroes(input[0].length); const sums = Utils.zeroes(input[0].length);
for (let value of input) { for (const value of input) {
for (let i = 0; i < value.length; i++) { for (let i = 0; i < value.length; i++) {
if (value[i] === "1") { if (value[i] === "1") {
sums[i] += 1; sums[i] += 1;
@@ -20,9 +21,9 @@ class Day3 {
return gamma * epsilon; return gamma * epsilon;
} }
public static part2(input: string[]): number { public part2(input: string[]): number {
return this.findLifeSupportRating(input, "oxygen") * this.findLifeSupportRating(input, "CO2"); return Day3.findLifeSupportRating(input, "oxygen") * Day3.findLifeSupportRating(input, "CO2");
} }
static findLifeSupportRating(input: string[], type: "oxygen" | "CO2"): number { static findLifeSupportRating(input: string[], type: "oxygen" | "CO2"): number {

129
functions/src/day4.ts Normal file
View File

@@ -0,0 +1,129 @@
import Day from "./day";
import Utils from "./utils";
class Day4 implements Day {
part1(input: string[]): number | string {
const { drawnNumbers, bingoCards } = this.parseInput(input);
// We are done as soon as we encounter the first bingo
return this.playBingo(drawnNumbers, bingoCards, () => ({ isDone: true }) ).score;
}
part2(input: string[]): number | string {
const { drawnNumbers, bingoCards } = this.parseInput(input);
// We are done when the first bingo is encountered before every card has had a bingo:
const bingo = this.playBingo(drawnNumbers, bingoCards, (b, bc, bcs) => ({ isDone: b.firstBingo && bcs.every(bc => bc.hadBingo) }));
return bingo.score;
}
playBingo(drawnNumbers: number[], bingoCards: BingoCard[], bingoHandler: (b: Bingo, bingoCard: BingoCard, allCards: BingoCard[]) => { isDone: boolean }): Bingo {
for (const draw of drawnNumbers) {
for (const bingoCard of bingoCards) {
const cardResult = bingoCard.cross(draw);
if (cardResult instanceof Bingo) {
const handleResult = bingoHandler(cardResult, bingoCard, bingoCards);
if (handleResult.isDone) return cardResult;
}
}
}
throw Error("We were never done...");
}
parseInput(input: string[]): { drawnNumbers: number[], bingoCards: BingoCard[] } {
const drawnNumbers = input[0].split(",").map(s => parseInt(s));
const bingoCards = [];
let currentCardNumbers: number[] = [];
let currentCardWidth = 0;
for (let i = 1; i < input.length; i++) {
// Empty line indicates a new bingo card
const line = input[i];
if (line === "") {
if (currentCardNumbers.length > 0) {
bingoCards.push(new BingoCard(currentCardNumbers, currentCardWidth));
}
currentCardNumbers = [];
currentCardWidth = 0;
} else {
const cardLine = line.split(/\s+/).filter(s => s != "").map(s => parseInt(s));
currentCardNumbers.push(...cardLine);
currentCardWidth = cardLine.length;
}
}
if (currentCardNumbers.length > 0) {
bingoCards.push(new BingoCard(currentCardNumbers, currentCardWidth));
}
return { drawnNumbers, bingoCards }
}
}
class BingoCard {
readonly numbers: number[];
readonly width: number;
crossed: boolean[];
hadBingo = false;
constructor(numbers: number[], width: number) {
this.numbers = numbers;
this.width = width;
this.crossed = new Array(numbers.length).fill(false);
}
/**
* Cross the given numbers of the bingo card. Returns Bingo if this card scored a bingo!
* @param nr
*/
cross(nr: number): null | Bingo {
const nrIndex = this.numbers.indexOf(nr);
if (nrIndex === -1) return null;
this.crossed[nrIndex] = true;
// Check for bingo
const rowStart = Math.floor(nrIndex / this.width) * this.width;
const rowComplete = this.crossed.slice(rowStart, rowStart + this.width).every(c => c);
const colStart = nrIndex % this.width;
const colComplete = this.crossed.filter((v, i) => i % this.width === colStart).every(c => c);
if (rowComplete || colComplete) {
const firstBingo = !this.hadBingo;
this.hadBingo = true;
return new Bingo(Utils.sum(this.numbers.filter((n, i) => !this.crossed[i])) * nr, nr, firstBingo);
} else {
return null;
}
}
}
class Bingo {
readonly score: number;
readonly winningNr: number;
readonly firstBingo: boolean;
constructor(score: number, winningNr: number, firstBingo: boolean) {
this.score = score;
this.winningNr = winningNr;
this.firstBingo = firstBingo;
}
}
export default Day4;

93
functions/src/day5.ts Normal file
View File

@@ -0,0 +1,93 @@
import Day from "./day";
import Vector2 from "./vector2";
class Day5 implements Day {
part1(input: string[]): number | string {
const vents = Day5.parseInput(input)
// For now, we should only consider purely horizontal or purely vertical vents:
.filter(v => v.start.x === v.end.x || v.start.y === v.end.y);
return Day5.countVentOverlaps(Day5.markVents(vents));
}
part2(input: string[]): number | string {
const vents = Day5.parseInput(input)
return Day5.countVentOverlaps(Day5.markVents(vents));
}
private static markVents(vents: Vent[]): Map<string, number> {
const grid = new Map<string, number>();
vents.forEach(v => Day5.markVent(v, grid));
return grid;
}
private static markVent(vent: Vent, grid: Map<string, number>) {
// Must be a diagonal line
const steps = Math.max(Math.abs(vent.end.x - vent.start.x), Math.abs(vent.end.y - vent.start.y));
const stepX = Day5.determineStep(vent.start.x, vent.end.x);
const stepY = Day5.determineStep(vent.start.y, vent.end.y);
for (let i = 0; i <= steps; i++) {
Day5.addVentPos(new Vector2(vent.start.x + stepX * i, vent.start.y + stepY * i), grid);
}
}
private static determineStep(start: number, end: number): number {
return start === end ? 0 : (start < end) ? 1 : -1;
}
private static countVentOverlaps(grid: Map<string, number>): number {
let count = 0;
for (const ventCount of grid.values()) {
if (ventCount >= 2) count++;
}
return count;
}
private static addVentPos(pos: Vector2, grid: Map<string, number>) {
const key = pos.key();
const existing = grid.get(key);
if (!existing) {
grid.set(key, 1);
} else {
grid.set(key, existing + 1);
}
}
private static parseInput(input: string[]): Vent[] {
const res: Vent[] = [];
for (const line of input) {
const startEnd = line.split(/\s*->\s*/);
res.push({
start: Vector2.parse(startEnd[0]),
end: Vector2.parse(startEnd[1])
});
}
return res;
}
}
class Vent {
readonly start: Vector2;
readonly end: Vector2;
constructor(start: Vector2, end: Vector2) {
this.start = start;
this.end = end;
}
}
export default Day5;

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

@@ -0,0 +1,17 @@
import Day from "./day";
class DayX implements Day {
part1(input: string[]): number | string {
// TODO implement
return 0;
}
part2(input: string[]): number | string {
// TODO implement
return 0;
}
}
export default DayX;

View File

@@ -1,9 +1,24 @@
import * as functions from "firebase-functions"; import * as functions from "firebase-functions";
import {Request, Response} from "firebase-functions";
import Utils from "./utils"; import Utils from "./utils";
import Day from "./day";
import Day1 from "./day1"; import Day1 from "./day1";
import {Response} from "firebase-functions";
import Day2 from "./day2"; import Day2 from "./day2";
import Day3 from "./day3"; 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 // // Start writing Firebase Functions
@@ -20,30 +35,33 @@ interface DayResult {
} }
export const day = { export const day = {
1: functions.region("europe-west1").https.onRequest((request, response) => { 1: functions.region("europe-west1").https.onRequest((request, response) => { processDay(new Day1(), request, response) }),
2: functions.region("europe-west1").https.onRequest((request, response) => { processDay(new Day2(), request, response) }),
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) }),
const input = Utils.parseInput(request); }
const part1 = Day1.part1(input);
const part2 = Day1.part2(input);
sendResponse(response, part1, part2);
}), function processDay(day: Day, request: Request, response: Response) {
2: functions.region("europe-west1").https.onRequest((request, response) => {
const input = Utils.parseInput(request); const input = Utils.parseInput(request);
const part1 = Day2.part1(input); const part1 = day.part1(input);
const part2 = Day2.part2(input); const part2 = day.part2(input);
sendResponse(response, part1, part2); sendResponse(response, part1, part2);
}),
3: functions.region("europe-west1").https.onRequest((request, response) => {
const input = Utils.parseInput(request);
const part1 = Day3.part1(input);
const part2 = Day3.part2(input);
sendResponse(response, part1, part2);
}),
} }
function sendResponse(response: Response, part1: string | number, part2: string | number) { function sendResponse(response: Response, part1: string | number, part2: string | number) {

View File

@@ -14,12 +14,24 @@ class Utils {
} }
static sum(values: number[]): number { 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[] { static zeroes(length: number): number[] {
let res = []; const res = [];
for (let i = 0; i < length; i++) { for (let i = 0; i < length; i++) {
res.push(0); res.push(0);
} }

31
functions/src/vector2.ts Normal file
View File

@@ -0,0 +1,31 @@
class Vector2 {
readonly x: number;
readonly y: number;
constructor(x: number, y: number) {
this.x = x;
this.y = y;
}
static parse(input: string): Vector2 {
const splitIndex = input.indexOf(",");
const xString = input.substr(0, splitIndex);
const yString = input.substr(splitIndex + 1);
return new Vector2(parseInt(xString), parseInt(yString));
}
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", "outDir": "lib",
"sourceMap": true, "sourceMap": true,
"strict": true, "strict": true,
"target": "es2017" "target": "es2020"
}, },
"compileOnSave": true, "compileOnSave": true,
"include": [ "include": [

View File

@@ -23,6 +23,18 @@
chalk "^2.0.0" chalk "^2.0.0"
js-tokens "^4.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": "@eslint/eslintrc@^0.4.3":
version "0.4.3" version "0.4.3"
resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" 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" resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf"
integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== 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@*": "@types/body-parser@*":
version "1.19.2" version "1.19.2"
resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.2.tgz#aea2059e28b7658639081347ac4fab3de166e6f0" 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" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"
integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== 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: acorn@^7.4.0:
version "7.4.1" version "7.4.1"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa"
integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== 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: agent-base@6:
version "6.0.2" version "6.0.2"
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" 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: dependencies:
color-convert "^2.0.1" 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: argparse@^1.0.7:
version "1.0.10" version "1.0.10"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
@@ -745,6 +792,11 @@ cors@^2.8.5:
object-assign "^4" object-assign "^4"
vary "^1" 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: cross-spawn@^7.0.2:
version "7.0.3" version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
@@ -814,6 +866,11 @@ dicer@^0.3.0:
dependencies: dependencies:
streamsearch "0.1.2" 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: doctrine@^2.1.0:
version "2.1.0" version "2.1.0"
resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d"
@@ -1903,6 +1960,11 @@ make-dir@^3.0.0:
dependencies: dependencies:
semver "^6.0.0" 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: media-typer@0.3.0:
version "0.3.0" version "0.3.0"
resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" 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" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= 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: tsconfig-paths@^3.11.0:
version "3.12.0" version "3.12.0"
resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz#19769aca6ee8f6a1a341e38c8fa45dd9fb18899b" 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" y18n "^5.0.5"
yargs-parser "^20.2.2" 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: yocto-queue@^0.1.0:
version "0.1.0" version "0.1.0"
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" 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
###

24
input/day/4-example.http Normal file
View File

@@ -0,0 +1,24 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-4
Content-Type: text/plain
7,4,9,5,11,17,23,2,0,14,21,24,10,16,13,6,15,25,12,22,18,20,8,19,3,26,1
22 13 17 11 0
8 2 23 4 24
21 9 14 16 7
6 10 3 18 5
1 12 20 15 19
3 15 0 2 22
9 18 13 17 5
19 8 7 25 23
20 11 10 24 4
14 21 16 12 6
14 21 17 24 4
10 16 15 9 19
18 8 23 26 20
22 11 13 6 5
2 0 12 3 7
###

606
input/day/4.http Normal file
View File

@@ -0,0 +1,606 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-4
Content-Type: text/plain
69,88,67,56,53,97,46,29,37,51,3,93,92,78,41,22,45,66,13,82,2,7,52,40,18,70,32,95,89,64,84,68,83,26,43,0,61,36,57,34,80,39,6,63,72,98,21,54,23,28,65,16,76,11,20,33,96,4,10,25,30,19,90,24,55,91,15,8,71,99,58,14,60,48,44,17,47,85,74,87,86,27,42,38,81,79,94,73,12,5,77,35,9,62,50,31,49,59,75,1
78 27 82 68 20
14 2 34 51 7
58 57 99 37 81
9 4 0 76 45
67 69 70 17 23
38 60 62 34 41
39 58 91 45 10
66 74 94 50 17
68 27 75 97 49
36 64 5 98 15
17 50 13 53 20
68 57 76 10 86
2 91 67 27 11
94 70 84 69 25
32 90 45 75 41
71 84 42 49 81
26 40 24 73 18
41 37 19 25 75
76 63 48 56 55
85 51 29 88 23
27 10 11 75 59
61 96 44 58 64
24 68 90 60 87
28 55 34 80 9
41 98 91 78 62
91 95 70 64 30
34 43 32 16 57
49 80 87 51 62
61 10 8 75 21
85 66 2 55 56
50 4 11 58 48
30 10 57 16 95
93 96 68 92 81
94 17 69 86 79
52 34 99 6 19
2 16 50 26 84
97 24 32 51 8
70 0 3 52 9
1 59 43 64 80
22 23 17 92 88
84 7 37 71 81
80 97 17 94 9
27 95 39 25 5
98 46 58 77 2
60 1 73 23 18
1 14 67 20 48
75 51 36 87 73
57 84 74 47 19
89 8 13 50 24
61 12 65 46 83
82 87 8 9 85
16 22 98 91 55
26 69 42 11 93
65 15 2 63 43
71 37 28 88 12
59 7 51 1 43
17 45 15 96 93
49 88 79 84 92
40 36 25 18 22
70 57 34 62 6
1 18 5 47 46
12 27 24 40 2
53 54 20 14 42
15 51 26 58 9
31 92 34 74 7
41 84 14 32 8
38 1 60 22 88
64 70 10 91 97
94 90 65 54 50
7 58 18 87 33
93 25 26 71 42
86 85 61 32 51
20 88 67 35 29
46 28 92 9 16
34 30 97 91 44
34 88 90 99 83
22 24 4 25 18
51 41 29 53 72
75 42 66 98 79
74 7 0 73 33
99 24 44 83 47
2 21 94 35 4
96 87 31 1 22
67 3 37 43 46
85 55 10 6 80
4 75 29 54 15
66 17 89 98 27
46 5 64 3 22
97 50 0 51 52
26 39 30 32 48
39 17 46 48 63
52 13 98 40 91
14 80 28 23 60
90 88 15 89 74
56 7 2 41 58
82 51 6 7 22
87 9 60 63 95
80 0 5 8 77
85 3 68 84 39
15 45 31 55 26
48 82 38 29 55
87 46 79 61 51
1 97 69 91 83
35 89 45 59 39
43 28 21 44 24
71 97 34 43 23
44 65 92 90 31
74 87 54 79 93
55 88 66 12 53
14 56 17 52 83
91 33 20 59 67
71 78 15 94 68
8 90 72 57 36
27 40 92 1 44
18 80 7 32 19
67 20 94 89 10
85 78 70 35 0
87 66 75 73 23
36 8 17 83 21
40 52 93 62 96
8 37 66 26 63
7 90 21 18 33
31 56 81 77 55
34 15 19 27 57
13 85 0 59 4
67 77 48 26 6
31 72 89 76 45
66 4 7 43 78
15 53 81 85 70
0 10 40 30 94
79 37 8 29 27
41 14 12 99 28
75 40 30 25 77
36 78 39 32 11
91 58 17 96 51
36 8 35 30 51
28 61 4 95 67
29 69 32 80 48
55 63 98 10 22
27 87 83 62 21
24 36 52 72 16
53 1 4 96 37
31 7 69 47 57
38 97 3 26 59
74 14 29 32 40
8 73 68 62 38
43 92 15 69 46
56 58 48 28 44
25 64 13 50 97
66 34 21 49 10
63 41 71 22 18
56 82 95 60 35
53 48 79 30 86
17 51 57 70 27
75 66 42 32 43
60 59 40 42 90
65 22 43 0 49
82 96 29 52 73
67 17 20 53 24
72 5 91 50 85
94 47 2 93 74
90 10 27 17 5
92 26 28 77 88
69 43 33 19 53
34 50 54 36 60
73 36 90 50 37
11 80 81 93 74
78 56 86 6 39
15 94 7 91 42
33 8 64 40 28
73 37 57 65 0
64 26 52 79 69
15 41 3 2 1
71 48 8 43 31
5 93 86 42 27
59 35 19 17 83
15 93 53 2 4
26 51 85 71 22
31 52 74 12 57
70 40 68 39 24
3 6 45 81 20
82 30 15 62 80
21 70 56 23 32
68 19 50 16 14
46 89 72 59 40
17 27 72 36 12
55 30 6 88 69
34 91 87 45 82
48 15 18 21 7
44 4 81 14 93
55 84 58 24 53
99 44 88 54 37
2 56 57 50 35
13 90 26 30 96
7 97 12 19 71
31 26 87 54 76
68 24 20 27 98
53 75 15 95 8
63 2 45 50 9
49 17 88 55 1
91 78 45 26 30
63 95 67 60 58
34 39 44 20 11
38 29 73 22 80
56 12 77 37 4
24 18 65 21 6
76 45 85 2 78
67 69 55 91 57
96 61 39 36 83
8 54 12 38 70
33 71 24 82 84
53 32 45 9 34
89 28 30 42 96
49 95 69 51 12
80 41 31 48 75
40 60 0 92 13
87 9 45 98 77
14 91 35 1 95
79 39 19 89 51
61 56 8 97 32
89 70 2 81 34
21 59 39 84 64
28 94 97 29 30
35 27 99 32 55
23 47 14 88 0
46 14 92 49 94
90 80 2 65 30
54 32 35 56 27
29 55 97 39 37
81 72 47 66 42
53 1 0 34 82
26 28 30 65 41
17 4 57 49 40
84 46 27 35 91
56 38 20 81 86
10 31 98 66 22
87 99 24 34 93
7 95 28 78 73
61 25 14 5 1
42 85 16 47 43
92 43 9 68 40
41 65 18 69 89
35 88 62 67 75
64 4 17 42 93
78 33 94 87 81
18 61 10 19 87
46 99 55 3 28
16 41 45 39 27
8 13 43 64 52
23 34 47 11 92
21 59 74 36 38
81 29 79 80 44
84 30 37 62 57
69 82 60 10 52
7 55 93 12 0
37 23 52 2 94
19 96 8 68 29
99 57 53 9 48
62 11 35 95 98
93 72 58 16 36
80 53 82 29 76
77 17 85 62 81
34 92 25 55 20
91 39 23 50 31
64 37 79 96 2
40 5 57 36 14
91 53 56 73 27
11 55 74 7 9
90 58 12 22 26
82 38 59 97 85
54 79 75 0 30
7 15 26 84 40
91 76 42 3 19
65 77 53 21 67
45 50 2 14 46
23 51 40 13 72
54 61 59 18 14
0 41 5 24 82
73 11 46 36 17
16 28 25 60 4
85 42 22 54 18
3 27 12 15 99
13 26 89 93 76
23 87 77 64 25
9 17 74 57 81
47 64 85 69 89
59 17 4 83 88
80 70 53 7 67
73 18 81 44 30
45 37 90 57 3
72 48 35 39 31
44 85 91 52 46
73 61 68 66 12
74 95 76 75 36
83 21 15 2 10
63 82 95 31 51
93 3 53 15 70
0 36 44 19 5
11 17 62 55 83
80 91 4 18 66
44 8 45 90 64
30 33 9 27 47
68 53 81 77 35
63 4 82 80 67
3 28 66 22 43
48 86 57 16 7
69 51 11 8 61
25 12 43 88 71
83 36 31 77 5
50 21 9 76 63
27 39 6 87 49
16 66 3 25 10
7 70 8 94 42
95 20 55 9 29
0 46 36 79 18
27 21 36 14 79
23 48 56 74 94
18 99 73 93 32
98 77 37 35 69
43 34 63 59 9
27 96 78 94 20
34 5 49 84 99
68 74 21 57 1
93 85 29 47 65
54 97 42 70 40
29 28 64 26 46
39 48 13 51 2
42 91 96 93 66
12 60 70 8 24
18 21 83 56 45
64 43 76 40 97
30 10 22 84 53
51 13 68 93 15
75 27 18 39 82
62 61 91 12 88
72 6 61 10 45
65 62 57 2 91
30 24 76 42 69
32 36 43 63 75
92 44 58 82 49
30 39 58 75 76
62 53 59 70 97
29 31 54 27 89
90 32 37 86 1
7 34 42 61 91
98 94 10 72 26
96 78 69 77 44
45 5 88 42 73
74 91 25 22 99
16 79 60 71 37
44 33 34 27 87
46 89 75 37 4
71 63 16 35 17
83 99 28 51 97
66 86 14 61 9
2 54 7 32 79
33 36 37 35 81
25 50 84 59 21
18 16 48 26 15
94 73 61 67 44
18 34 66 57 31
74 92 71 59 19
36 94 16 80 24
35 54 58 87 64
73 90 41 49 88
74 5 57 40 21
61 11 50 80 66
35 58 52 10 56
92 67 82 46 72
32 18 33 34 55
66 79 27 24 46
98 4 30 80 49
19 23 68 18 90
41 91 83 63 77
84 12 8 10 21
23 47 58 5 20
30 32 61 6 28
24 11 8 33 10
52 93 95 0 45
22 27 3 82 40
11 51 47 83 38
28 85 9 10 48
80 60 46 55 32
89 14 90 71 50
0 65 24 40 19
12 2 37 62 93
78 69 53 43 33
85 76 26 21 92
36 54 89 46 91
29 18 72 9 51
82 36 47 95 30
65 2 98 92 12
93 73 44 48 6
31 74 62 27 42
32 13 11 99 50
89 31 94 1 78
77 24 46 64 26
11 16 28 30 45
80 22 5 8 52
32 38 76 65 90
92 96 35 86 51
47 75 17 87 30
43 29 55 50 11
77 99 48 24 20
37 7 91 23 8
26 12 82 95 78
41 65 80 53 44
75 43 32 46 84
63 99 69 45 88
56 48 87 38 49
8 87 21 27 15
84 44 26 61 82
10 66 29 95 65
4 86 38 91 28
14 49 22 52 54
27 43 13 35 33
20 66 77 70 31
5 17 94 98 83
11 22 39 55 75
53 61 46 38 89
84 49 52 32 51
90 46 97 91 54
2 42 65 10 25
80 77 31 81 16
58 17 15 26 55
19 83 57 21 95
4 29 11 64 0
17 63 13 27 58
14 96 43 22 56
97 84 81 67 94
47 49 4 70 65
60 88 9 77 3
63 72 33 50 97
68 84 98 78 89
10 79 25 24 54
81 70 39 73 11
86 30 38 14 91
9 18 72 21 24
54 83 80 78 66
23 93 36 31 53
34 58 18 69 28
57 70 54 50 64
35 36 4 56 72
32 16 45 33 17
83 60 39 22 47
31 73 56 21 63
66 14 42 45 80
60 57 47 36 78
93 75 44 22 11
68 89 58 88 17
74 16 65 13 45
86 20 6 34 15
70 46 59 75 57
28 62 67 71 98
77 63 25 61 64
71 20 42 65 47
29 80 53 78 99
70 57 18 45 32
86 46 35 77 26
15 91 93 55 67
27 16 31 41 42
77 34 10 90 18
28 99 44 20 68
98 82 3 75 62
88 85 47 17 71
31 95 98 60 93
80 81 23 35 70
4 57 38 69 76
18 0 41 86 54
47 26 90 65 39
79 86 59 66 50
49 64 65 95 6
90 67 36 32 46
10 20 25 27 1
87 21 17 78 13
16 8 95 35 43
14 0 72 89 68
52 11 12 67 25
63 64 13 32 15
53 98 55 81 75
51 85 15 91 10
24 68 80 22 8
55 18 36 30 66
27 21 46 63 26
81 5 14 2 13
71 39 19 40 69
58 70 65 46 78
98 14 59 94 60
12 55 68 91 0
18 35 25 61 86
85 74 56 43 44
98 78 17 95 8
70 30 66 55 94
57 62 82 49 77
61 32 97 88 58
23 1 53 65 30
45 15 9 26 28
2 21 42 27 12
84 68 71 19 13
58 57 35 77 14
###

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

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

505
input/day/5.http Normal file
View File

@@ -0,0 +1,505 @@
POST http://localhost:5001/advent-of-code-2021-911a8/europe-west1/day-5
Content-Type: text/plain
777,778 -> 777,676
500,510 -> 378,510
441,657 -> 441,638
724,480 -> 724,778
702,85 -> 44,85
973,961 -> 28,16
913,125 -> 483,125
714,895 -> 870,739
273,774 -> 273,795
623,450 -> 623,616
157,49 -> 987,879
430,775 -> 382,775
58,938 -> 718,278
290,366 -> 604,680
75,252 -> 760,937
46,947 -> 788,205
731,197 -> 28,197
25,15 -> 964,954
317,440 -> 66,691
166,427 -> 544,805
686,800 -> 50,164
858,569 -> 447,569
596,50 -> 596,327
739,218 -> 739,278
382,852 -> 382,960
11,984 -> 970,25
911,390 -> 790,511
739,299 -> 739,254
989,172 -> 989,567
36,335 -> 249,335
60,900 -> 121,900
299,380 -> 299,178
701,932 -> 701,224
626,282 -> 641,282
83,532 -> 83,91
246,125 -> 95,125
73,446 -> 308,446
902,907 -> 26,31
841,298 -> 841,547
264,737 -> 974,27
170,199 -> 170,120
135,428 -> 319,244
431,240 -> 431,691
406,935 -> 889,935
192,526 -> 192,82
236,54 -> 236,574
667,369 -> 667,559
501,42 -> 620,42
130,973 -> 208,973
213,639 -> 542,639
943,266 -> 247,962
545,864 -> 423,864
252,698 -> 359,698
314,501 -> 314,948
203,974 -> 472,974
947,125 -> 175,897
956,544 -> 512,544
862,264 -> 549,577
606,138 -> 606,862
239,123 -> 902,786
201,643 -> 201,473
916,375 -> 916,807
10,10 -> 988,988
490,659 -> 490,559
72,66 -> 967,961
215,225 -> 215,281
930,856 -> 203,856
172,481 -> 172,23
867,684 -> 349,166
843,45 -> 843,971
250,779 -> 884,779
973,464 -> 973,794
543,868 -> 39,364
968,424 -> 968,289
470,489 -> 936,489
411,573 -> 411,206
120,691 -> 120,401
134,649 -> 412,649
452,203 -> 452,597
155,604 -> 155,278
914,854 -> 685,854
38,972 -> 975,35
153,403 -> 418,403
731,152 -> 295,588
242,560 -> 513,289
930,619 -> 506,195
547,320 -> 899,320
237,368 -> 479,126
417,842 -> 26,842
213,581 -> 506,288
741,597 -> 742,596
79,440 -> 79,108
424,946 -> 985,946
535,833 -> 716,833
249,328 -> 772,328
616,905 -> 981,905
46,877 -> 227,877
841,770 -> 747,770
202,44 -> 633,475
556,354 -> 556,829
617,864 -> 129,376
318,310 -> 318,927
259,300 -> 259,485
167,482 -> 167,265
349,184 -> 885,184
616,199 -> 921,199
710,162 -> 710,373
499,87 -> 499,214
905,51 -> 258,51
134,739 -> 858,739
879,428 -> 496,45
208,599 -> 208,908
68,225 -> 268,225
581,456 -> 86,456
898,318 -> 278,318
84,910 -> 940,54
344,206 -> 798,660
51,75 -> 909,933
783,780 -> 94,91
907,935 -> 808,836
556,736 -> 556,592
39,611 -> 859,611
29,73 -> 29,438
898,390 -> 898,518
777,647 -> 163,33
144,962 -> 523,962
827,676 -> 469,318
267,647 -> 360,647
742,438 -> 660,438
214,76 -> 214,873
550,177 -> 923,550
182,191 -> 329,191
765,737 -> 765,118
387,322 -> 895,322
174,785 -> 714,245
733,453 -> 852,453
497,136 -> 131,502
574,931 -> 574,568
282,198 -> 282,412
971,324 -> 940,355
827,358 -> 130,358
954,726 -> 311,83
207,195 -> 936,195
42,935 -> 921,56
955,46 -> 35,966
627,361 -> 627,888
37,202 -> 91,202
697,599 -> 155,57
227,264 -> 285,264
50,790 -> 797,43
717,693 -> 88,64
145,234 -> 628,234
358,791 -> 835,791
765,739 -> 765,888
900,204 -> 581,204
544,789 -> 367,789
508,424 -> 689,424
23,964 -> 976,11
404,728 -> 404,949
327,891 -> 327,431
596,204 -> 596,95
686,201 -> 686,982
132,836 -> 132,11
574,434 -> 574,862
41,60 -> 936,955
283,246 -> 283,11
29,226 -> 962,226
483,916 -> 483,562
962,913 -> 131,82
455,316 -> 729,42
858,503 -> 165,503
795,68 -> 388,475
697,477 -> 986,477
932,633 -> 932,114
376,730 -> 270,730
598,672 -> 833,672
69,46 -> 935,46
178,95 -> 862,779
633,73 -> 34,672
488,690 -> 517,661
784,450 -> 784,986
955,560 -> 955,760
651,959 -> 172,480
406,330 -> 406,439
955,737 -> 987,737
194,272 -> 843,921
18,553 -> 93,553
422,387 -> 249,387
318,79 -> 494,79
181,814 -> 709,814
63,62 -> 987,986
636,357 -> 162,357
973,15 -> 27,961
444,415 -> 58,415
884,531 -> 447,968
320,928 -> 73,928
154,357 -> 426,357
200,482 -> 367,315
505,872 -> 505,861
314,432 -> 502,244
912,676 -> 912,618
683,590 -> 881,788
761,708 -> 761,758
40,941 -> 543,438
847,370 -> 801,370
701,297 -> 619,297
140,618 -> 725,618
72,24 -> 968,920
767,396 -> 434,63
710,918 -> 213,421
917,770 -> 92,770
20,979 -> 987,12
909,62 -> 152,62
932,987 -> 56,111
460,382 -> 797,719
518,388 -> 964,388
456,299 -> 456,15
84,783 -> 786,783
982,669 -> 58,669
140,156 -> 140,130
613,264 -> 613,582
267,636 -> 267,805
141,631 -> 762,631
575,26 -> 243,358
318,900 -> 704,514
118,914 -> 118,757
952,846 -> 99,846
673,353 -> 673,633
422,130 -> 228,130
738,52 -> 717,73
307,307 -> 126,307
484,161 -> 942,619
576,886 -> 52,362
375,297 -> 505,297
950,82 -> 243,789
411,57 -> 411,844
879,137 -> 879,334
483,703 -> 483,213
192,24 -> 74,142
561,286 -> 263,584
493,121 -> 493,604
715,576 -> 715,945
238,258 -> 461,258
331,470 -> 851,470
435,22 -> 435,273
315,377 -> 135,557
128,195 -> 794,861
391,143 -> 391,580
33,680 -> 814,680
611,50 -> 611,79
650,28 -> 650,57
196,538 -> 622,964
333,222 -> 333,457
313,254 -> 803,254
508,581 -> 41,581
40,411 -> 55,411
458,600 -> 775,283
105,678 -> 105,345
397,546 -> 814,963
915,669 -> 915,793
773,952 -> 395,574
884,198 -> 404,198
408,929 -> 408,623
123,158 -> 340,158
418,927 -> 757,588
304,338 -> 304,990
505,184 -> 505,28
938,869 -> 938,181
11,959 -> 949,21
232,949 -> 232,660
479,826 -> 479,69
323,427 -> 834,427
460,385 -> 460,94
199,529 -> 493,823
767,58 -> 134,691
901,320 -> 861,320
31,354 -> 28,354
335,165 -> 980,810
586,394 -> 277,394
106,807 -> 567,346
814,987 -> 79,987
166,766 -> 166,990
883,213 -> 676,420
458,454 -> 936,454
878,953 -> 878,682
868,340 -> 868,503
778,252 -> 778,159
237,611 -> 928,611
221,357 -> 643,779
793,775 -> 509,491
719,78 -> 719,878
764,722 -> 107,65
696,323 -> 696,816
49,726 -> 385,726
730,974 -> 386,974
973,310 -> 973,748
12,173 -> 200,173
164,482 -> 473,482
802,807 -> 648,807
104,843 -> 747,843
154,919 -> 802,271
919,837 -> 150,837
882,930 -> 882,752
717,468 -> 461,468
925,112 -> 925,329
714,688 -> 714,66
35,781 -> 737,79
644,139 -> 819,139
340,500 -> 340,195
10,909 -> 524,909
914,790 -> 82,790
962,271 -> 257,976
352,170 -> 352,239
666,39 -> 614,39
854,937 -> 818,901
88,865 -> 852,101
121,796 -> 907,10
836,572 -> 836,649
976,953 -> 976,54
566,584 -> 566,216
927,702 -> 927,703
896,441 -> 896,741
20,30 -> 958,968
934,804 -> 238,804
562,323 -> 12,323
789,550 -> 356,550
906,225 -> 906,886
513,819 -> 513,157
129,80 -> 977,928
37,815 -> 50,802
325,30 -> 899,604
183,614 -> 647,614
497,170 -> 662,170
598,134 -> 228,134
57,636 -> 57,390
11,938 -> 649,300
911,952 -> 850,952
35,950 -> 698,950
161,239 -> 536,239
359,569 -> 359,238
711,945 -> 599,945
866,756 -> 866,987
674,978 -> 96,400
254,653 -> 254,590
655,810 -> 256,810
942,892 -> 394,344
895,744 -> 895,408
549,478 -> 395,478
162,193 -> 162,527
347,242 -> 823,242
251,867 -> 251,77
167,233 -> 285,233
189,969 -> 866,292
847,118 -> 52,913
206,650 -> 131,725
34,790 -> 34,824
872,441 -> 475,838
242,538 -> 718,62
456,514 -> 233,514
384,761 -> 640,761
782,388 -> 782,949
928,809 -> 928,618
461,415 -> 869,823
240,487 -> 215,487
970,687 -> 737,920
63,749 -> 63,493
274,99 -> 462,99
941,989 -> 58,106
142,594 -> 788,594
120,705 -> 535,705
680,248 -> 631,248
544,807 -> 544,737
972,606 -> 972,706
846,800 -> 84,38
836,108 -> 35,909
691,290 -> 691,377
979,883 -> 293,197
766,851 -> 955,851
737,551 -> 713,551
247,70 -> 247,592
855,153 -> 715,13
432,263 -> 797,263
495,839 -> 184,839
544,923 -> 544,45
887,676 -> 875,676
922,230 -> 922,900
168,612 -> 31,749
505,446 -> 625,326
504,370 -> 504,511
943,538 -> 943,784
653,40 -> 653,712
613,973 -> 760,973
152,824 -> 550,426
335,35 -> 57,313
614,334 -> 614,938
399,205 -> 961,767
387,903 -> 583,903
218,395 -> 190,395
935,524 -> 935,402
821,111 -> 821,372
609,621 -> 220,621
503,288 -> 467,324
641,139 -> 641,369
420,924 -> 420,532
344,504 -> 344,698
340,96 -> 169,96
835,505 -> 640,700
464,344 -> 464,133
946,396 -> 946,10
295,313 -> 437,171
330,286 -> 291,286
608,653 -> 608,613
360,410 -> 749,410
115,288 -> 115,334
915,550 -> 915,858
902,16 -> 143,775
201,901 -> 170,932
37,968 -> 987,18
40,332 -> 586,878
271,407 -> 271,858
836,674 -> 624,674
308,715 -> 361,715
733,818 -> 449,818
23,36 -> 862,875
278,655 -> 685,655
924,764 -> 924,913
479,250 -> 850,621
312,116 -> 468,272
10,954 -> 891,73
554,313 -> 918,677
846,773 -> 846,476
681,948 -> 681,961
418,835 -> 263,835
352,222 -> 557,222
782,188 -> 782,11
609,845 -> 954,845
866,882 -> 310,882
479,180 -> 119,540
278,866 -> 140,866
874,617 -> 505,617
491,942 -> 280,942
584,574 -> 839,829
475,466 -> 620,466
652,215 -> 652,85
906,746 -> 906,824
381,317 -> 749,685
294,837 -> 294,165
450,893 -> 430,893
99,374 -> 99,864
919,313 -> 99,313
187,91 -> 187,304
654,982 -> 654,324
662,223 -> 471,223
848,554 -> 848,13
14,851 -> 14,855
438,287 -> 531,287
611,277 -> 309,277
630,379 -> 630,99
621,531 -> 787,531
12,292 -> 12,11
18,985 -> 162,985
49,919 -> 530,438
329,828 -> 369,868
725,976 -> 725,267
826,591 -> 826,562
249,651 -> 280,651
467,461 -> 759,461
720,968 -> 745,968
414,29 -> 54,389
204,740 -> 91,853
694,300 -> 694,393
517,748 -> 517,231
465,946 -> 718,946
252,322 -> 902,972
109,641 -> 692,641
973,969 -> 104,100
302,368 -> 302,914
385,19 -> 385,192
460,851 -> 387,851
310,221 -> 660,571
684,147 -> 642,147
371,711 -> 169,913
810,727 -> 810,559
428,576 -> 88,236
381,33 -> 655,307
37,428 -> 37,68
11,29 -> 962,980
880,698 -> 227,45
624,361 -> 624,351
487,917 -> 183,613
725,498 -> 725,889
880,71 -> 27,924
856,752 -> 274,752
541,419 -> 516,419
803,688 -> 152,37
835,304 -> 964,304
480,249 -> 74,655
742,883 -> 213,883
943,41 -> 378,41
869,924 -> 869,563
###

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
###