adventofcode/2018/day03-1.go

26 lines
361 B
Go
Raw Normal View History

2018-12-03 21:53:58 +00:00
package main
import (
"fmt"
"internal/day03"
2018-12-03 21:53:58 +00:00
"internal/util"
)
func main() {
data := util.ReadInput()
claims, maxX, maxY := day03.ParseClaims(data)
grid := day03.PopulateGrid(claims, maxX, maxY)
2018-12-03 21:53:58 +00:00
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)
}