From 4593c171d834c831e8ff40449023b80864c55ede Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Sat, 2 Dec 2023 22:52:38 +0000 Subject: [PATCH] no need to check if colour count is 0, just bump. --- day-2/two.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/day-2/two.go b/day-2/two.go index 2623be6..4cce14b 100644 --- a/day-2/two.go +++ b/day-2/two.go @@ -20,9 +20,7 @@ func powerForGame(data string) (int, error) { if err != nil { return 0, err } - if counter[colour] == 0 { - counter[colour] = n - } else if counter[colour] < n { + if counter[colour] < n { counter[colour] = n } }