From 372a65cc51a297acf0fdd187c8d4f3610299c19e Mon Sep 17 00:00:00 2001 From: nim from KA <35317534+nim-ka@users.noreply.github.com> Date: Thu, 17 Nov 2022 16:00:25 -0500 Subject: [PATCH] Update 6.js --- 2021/6.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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] }