This commit is contained in:
Gabriel Bizdoc 2025-12-14 01:53:56 +02:00
parent c79d562490
commit a82ebb6c37
No known key found for this signature in database
GPG Key ID: 3F0EDAECA5BE9ED9

View File

@ -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")