day 12
This commit is contained in:
parent
c79d562490
commit
a82ebb6c37
@ -107,11 +107,11 @@ func parseInput(ctx aoc.Context) (input Input, err error) {
|
|||||||
var region Region
|
var region Region
|
||||||
parts := strings.Split(regionStr, ": ")
|
parts := strings.Split(regionStr, ": ")
|
||||||
for _, idstr := range strings.Split(parts[1], " ") {
|
for _, idstr := range strings.Split(parts[1], " ") {
|
||||||
id, err := strconv.Atoi(idstr)
|
count, err := strconv.Atoi(idstr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return input, fmt.Errorf("day12: failed to parse region id: %w", err)
|
return input, fmt.Errorf("day12: failed to parse region count: %w", err)
|
||||||
}
|
}
|
||||||
region.ShapeCounts = append(region.ShapeCounts, id)
|
region.ShapeCounts = append(region.ShapeCounts, count)
|
||||||
}
|
}
|
||||||
|
|
||||||
parts2 := strings.Split(parts[0], "x")
|
parts2 := strings.Split(parts[0], "x")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user