fix scaffolding, start d3

This commit is contained in:
Leonard Lorenz 2025-12-03 10:24:15 +01:00
parent 048cc9d4c2
commit af91eb4ed5
6 changed files with 61 additions and 22 deletions

29
solutions/03.ts Normal file
View file

@ -0,0 +1,29 @@
import { solvables } from "../main.ts";
import type { Day } from "../day.ts";
import { readInput } from "../utils.ts";
class DayImpl implements Day {
day = 3
input = readInput('03')
public part1(): Day {
const vals: string[] = this.input
.split("\n")
const result = vals.map(battery => {
const sorted = battery.split("").sort()
return Number.parseInt(sorted[0]) + Number.parseInt(sorted[1])
}).reduce((a, b) => a + b, 0)
console.log(result)
return this
}
public part2(): Day {
return this
}
}
solvables.push(new DayImpl())