Skip to content

Commit fd73ab9

Browse files
authored
Merge pull request #231 from romellem/2024/day-5
2024 - Day 5
2 parents bd9fe92 + 814243a commit fd73ab9

File tree

5 files changed

+1478
-0
lines changed

5 files changed

+1478
-0
lines changed

2024/5/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Answers
2+
3+
| Part 1 | Part 2 |
4+
| ------ | ------ |
5+
| ` ` | ` ` |
6+

2024/5/input.ts

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import path from 'path';
2+
import fs from 'fs';
3+
4+
const [rawOrderingRules, rawPages] = fs
5+
.readFileSync(path.join(import.meta.dirname, 'input.txt'), 'utf8')
6+
.toString()
7+
.trim()
8+
.split('\n\n');
9+
10+
export const orderingRules = rawOrderingRules.split('\n').map((rule: string) => {
11+
return rule.split('|').map((v) => parseInt(v, 10)) as [number, number];
12+
});
13+
14+
export const pages = rawPages
15+
.split('\n')
16+
.map((line: string) => line.split(',').map((v) => parseInt(v, 10)));

0 commit comments

Comments
 (0)