-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathd7.test.ts
41 lines (37 loc) · 854 Bytes
/
d7.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { describe, expect, it } from 'bun:test'
import { part1, part2 } from './d7'
import { readInput } from '../utils/fs'
describe('d7:p1', () => {
it('should solve example case', () => {
expect(
part1(
`32T3K 765
T55J5 684
KK677 28
KTJJT 220
QQQJA 483`,
),
).toEqual(6440)
})
it('should solve puzzle input', async () => {
const input = await readInput('d7.txt')
expect(part1(input)).toEqual(249204891)
})
})
describe('d7:p2', () => {
it('should solve example case', () => {
expect(
part2(
`32T3K 765
T55J5 684
KK677 28
KTJJT 220
QQQJA 483`,
),
).toEqual(5905)
})
it('should solve puzzle input', async () => {
const input = await readInput('d7.txt')
expect(part2(input)).toEqual(249666369)
})
})