diff --git a/day-4/one.go b/day-4/one.go index d806877..fa54c38 100644 --- a/day-4/one.go +++ b/day-4/one.go @@ -5,6 +5,15 @@ import ( "unicode" ) +// Card represents a single card. +// it tracks its number of matches and occurrences +type Card struct { + matches int + occurrences int +} + +var cards = []Card{} + // one computes points based on matching numbers func one(lines []string) (int, error) { f := func(c rune) bool { diff --git a/day-4/two.go b/day-4/two.go index 8732ca5..96b9754 100644 --- a/day-4/two.go +++ b/day-4/two.go @@ -1,14 +1,5 @@ package main -// Cards represents a single card. -// it tracks its matching numbers and occurrences -type Card struct { - matches int - occurrences int -} - -var cards = []Card{} - // two returns the total number of occurrences for all cards func two(lines []string) (int, error) { var sum = 0