adventofcode/2018/day03-1.go
2018-12-03 16:53:58 -05:00

26 lines
364 B
Go

package main
import (
"fmt"
"internal/fabric"
"internal/util"
)
func main() {
data := util.ReadInput()
claims, maxX, maxY := fabric.ParseClaims(data)
grid := fabric.PopulateGrid(claims, maxX, maxY)
count := 0
for y := 0; y < len(grid); y++ {
for x := 0; x < len(grid[y]); x++ {
if grid[y][x] == -1 {
count++
}
}
}
fmt.Println(count)
}