mirror of
https://github.com/Threnklyn/advent-of-code-go.git
synced 2026-06-07 20:53:30 +02:00
updated util packages
This commit is contained in:
+4
-3
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user