26 lines
364 B
Go
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)
|
||
|
}
|