Solve 2024-17

This commit is contained in:
2024-12-17 18:42:35 +01:00
parent c32296f243
commit a2f386277f
6 changed files with 174 additions and 4 deletions
+21
View File
@@ -0,0 +1,21 @@
import { describe, expect, it } from 'bun:test';
import { solveFirst, solveSecond } from './index.ts';
describe('2024-17', () => {
it('first', () => {
const testInput = `Register A: 729
Register B: 0
Register C: 0
Program: 0,1,5,4,3,0`;
expect(solveFirst(testInput)).toBe('4,6,3,5,6,3,5,2,1,0');
});
it('second', () => {
const testInput = `Register A: 2024
Register B: 0
Register C: 0
Program: 0,3,5,4,3,0`;
expect(solveSecond(testInput)).toBe(117440);
});
});