updated util packages

This commit is contained in:
alexchao26
2020-12-10 01:04:51 -05:00
parent b9a74cf122
commit 1fec4f74d3
47 changed files with 285 additions and 95 deletions
+4 -3
View File
@@ -6,6 +6,7 @@ import (
"strconv"
"strings"
"github.com/alexchao26/advent-of-code-go/mathutil"
"github.com/alexchao26/advent-of-code-go/util"
)
@@ -53,13 +54,13 @@ func part1(input string) int {
playerTurn %= players
}
return util.MaxInts(playerScores...)
return mathutil.MaxInt(playerScores...)
}
func part2(input string) int {
// lazily modify input...
split := strings.Split(input, " ")
steps := util.StrToInt(split[6]) * 100
steps := mathutil.StrToInt(split[6]) * 100
split[6] = strconv.Itoa(steps)
return part1(strings.Join(split, " "))
@@ -67,7 +68,7 @@ func part2(input string) int {
func parseInput(input string) (players int, lastPoints int) {
split := strings.Split(input, " ")
return util.StrToInt(split[0]), util.StrToInt(split[6])
return mathutil.StrToInt(split[0]), mathutil.StrToInt(split[6])
}
type CircularLinkedListNode struct {