13 lines
278 B
Go
13 lines
278 B
Go
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)
|
|
}
|