diff --git a/2021/6.js b/2021/6.js index 36a634f..8ecba89 100644 --- a/2021/6.js +++ b/2021/6.js @@ -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] }