Update 6.js

This commit is contained in:
nim from KA
2022-11-17 16:00:25 -05:00
committed by GitHub
parent 9731181c2c
commit 372a65cc51

View File

@@ -4,7 +4,7 @@ function day6(input, part2) {
let counts = Array(9).fill().map((_, i) => input.count(i))
for (let i = 0; i < (part2 ? 256 : 80); i++) {
counts = counts.rotate(1)
counts.push(counts.shift())
counts[6] += counts[8]
}