2023-12-02 01:01:55 +00:00
|
|
|
import { readlines } from "../../_utils";
|
2022-12-03 22:11:42 +00:00
|
|
|
|
|
|
|
const solution = require("./solution");
|
|
|
|
|
|
|
|
describe("day 3: rucksack reorganization, pt 1", () => {
|
|
|
|
test("sample input", async () => {
|
|
|
|
const sample = await readlines("./day_03/sample.txt");
|
|
|
|
expect(solution.part1_solver(sample)).toBe(157);
|
|
|
|
});
|
|
|
|
|
|
|
|
test("submission input", async () => {
|
|
|
|
const input = await readlines("./day_03/input.txt");
|
|
|
|
expect(solution.part1_solver(input)).toBe(8109);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe("day 3: rucksack reorganization, pt 2", () => {
|
|
|
|
test("sample input", async () => {
|
|
|
|
const sample = await readlines("./day_03/sample.txt");
|
|
|
|
expect(solution.part2_solver(sample)).toBe(70);
|
|
|
|
});
|
|
|
|
|
|
|
|
test("submission input", async () => {
|
|
|
|
const input = await readlines("./day_03/input.txt");
|
|
|
|
expect(solution.part2_solver(input)).toBe(2738);
|
|
|
|
});
|
|
|
|
});
|