chore: clean up day 3
All checks were successful
Go Bump / bump (push) Successful in 7s
Go Test / build (push) Successful in 20s

This commit is contained in:
xuu
2023-12-09 14:57:02 -07:00
parent 7826654bce
commit 3f5ffa515c
4 changed files with 67 additions and 15 deletions

View File

@@ -4,7 +4,6 @@ import (
"bufio"
"cmp"
"fmt"
"strconv"
"strings"
aoc "go.sour.is/advent-of-code-2023"
@@ -31,13 +30,7 @@ func run(scan *bufio.Scanner) (*result, error) {
if len(text) == 0 {
continue
}
histories = append(histories, nil)
for _, s := range strings.Fields(text) {
if i, err := strconv.Atoi(s); err == nil {
histories[len(histories)-1] = append(histories[len(histories)-1], i)
}
}
histories = append(histories, aoc.ReadStringToInts(strings.Fields(text)))
log(last(histories...))