fix: remove row and col loops
This commit is contained in:
+4
-9
@@ -17,15 +17,10 @@ func SolvePartOne(filePath string) int {
|
|||||||
|
|
||||||
var startPosition position.Position
|
var startPosition position.Position
|
||||||
|
|
||||||
for row := range grid.NumberOfRows() - 1 {
|
for p, v := range grid.Positions() {
|
||||||
for col := range grid.NumberOfColumns() - 1 {
|
if v == StartCharacter {
|
||||||
current := position.From(row, col)
|
startPosition = p
|
||||||
v := grid.GetValueAt(current)
|
break
|
||||||
|
|
||||||
if v == StartCharacter {
|
|
||||||
startPosition = current
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user