Solve 2024-11

This commit is contained in:
2024-12-11 15:30:15 +01:00
parent 69f6f10656
commit 3c9b48b3a6
4 changed files with 111 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
import { describe, expect, it } from 'bun:test';
import { solve, solveFirstSlow } from './index.ts';
describe('2024-11', () => {
const testInput = `125 17`;
it('first slow', () => {
// it takes too long
// so only run while `NODE_ENV=production bun test --coverage`
if (process.env.NODE_ENV === 'production') {
expect(solveFirstSlow(testInput)).toBe(55312);
}
});
it('first', () => {
expect(solve(testInput, 25)).toBe(55312);
});
it('second', () => {
expect(solve(testInput, 75)).toBeGreaterThan(55312);
});
});