remove bounds check for first neighbour.

This commit is contained in:
onyx-and-iris 2024-12-26 22:55:23 +00:00
parent 4013cd6c7f
commit a282338f29

View File

@ -20,10 +20,6 @@ func Solve(buf []byte) (int, error) {
current := newPoint(j, i) current := newPoint(j, i)
if graph.valueAt(current) == 'X' { if graph.valueAt(current) == 'X' {
for _, n := range neighbours(current) { for _, n := range neighbours(current) {
if graph.isOutOfBounds(n) {
continue
}
if checkNeighbours(graph, n, "MAS") { if checkNeighbours(graph, n, "MAS") {
sum++ sum++
} }