mirror of
https://github.com/onyx-and-iris/aoc2024.git
synced 2025-01-09 22:30:47 +00:00
remove bounds check for first neighbour.
This commit is contained in:
parent
4013cd6c7f
commit
a282338f29
@ -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++
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user