aoc21/d5/p1.go

14 lines
278 B
Go
Raw Permalink Normal View History

2022-02-21 22:28:30 +02:00
package d5
import (
"strings"
)
func P1(input string) int {
lines := strings.Split(strings.TrimSpace(input), "\n")
segments := createSegments(lines)
points := generatePoints(segments)
intersections := findIntersections(points)
return countIntersections(intersections)
}