Skip to content

Commit 81a5501

Browse files
committed
Add another note
1 parent 51e7f11 commit 81a5501

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

day18/src/Day18.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,13 @@ private static record Board(List<List<Character>> rows) {
3535
public final OptionalInt findShortestPath() {
3636
// Your run-of-the-mill Dijkstra implementation.
3737

38-
// We could probably optimize this a bit by adding one of the A*
38+
// Note 1: We could probably optimize this a bit by adding one of the A*
3939
// heuristics (e.g. use abs(pos.x - end.x) + abs(pos.y - end.y) to
4040
// estimate the distance to the goal), but this works well enough.
4141

42+
// Note 2: BFS would have probably already worked, since we're dealing
43+
// with distances of 1 on a grid... but hey, it works!
44+
4245
Vec2 start = getStart();
4346
Vec2 end = getEnd();
4447

0 commit comments

Comments
 (0)