mirror of
https://github.com/Threnklyn/advent-of-code-go.git
synced 2026-06-07 12:45:10 +02:00
!changed mathutil package to mathy, removed int/string casting from mathy
This commit is contained in:
+3
-3
@@ -5,7 +5,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/alexchao26/advent-of-code-go/mathutil"
|
||||
"github.com/alexchao26/advent-of-code-go/cast"
|
||||
"github.com/alexchao26/advent-of-code-go/util"
|
||||
)
|
||||
|
||||
@@ -89,9 +89,9 @@ func makeGraphFromInput(input string) map[int][]int {
|
||||
graph := make(map[int][]int, len(lines))
|
||||
for _, l := range lines {
|
||||
parts := strings.Split(l, " <-> ")
|
||||
ID := mathutil.StrToInt(parts[0])
|
||||
ID := cast.ToInt(parts[0])
|
||||
for _, child := range strings.Split(parts[1], ", ") {
|
||||
graph[ID] = append(graph[ID], mathutil.StrToInt(child))
|
||||
graph[ID] = append(graph[ID], cast.ToInt(child))
|
||||
}
|
||||
}
|
||||
return graph
|
||||
|
||||
Reference in New Issue
Block a user