Skip to content

Commit

Permalink
[2024/10] use bfs instead (not that it matters, dfs gives the same re…
Browse files Browse the repository at this point in the history
…sults - but bfs is how I thought about the problem)
  • Loading branch information
StarlitGhost committed Dec 10, 2024
1 parent 4caf207 commit 8a45499
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 2024/10/script.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from GhostyUtils import aoc
from GhostyUtils.grid import Grid
from GhostyUtils.pathfinding import dfs
from GhostyUtils.pathfinding import bfs
import functools


Expand All @@ -27,7 +27,7 @@ def main():
total_rating = 0
for trailhead in grid.find_all(0):
ends = set()
for path in dfs(start=trailhead, end=None, all_paths=True,
for path in bfs(start=trailhead, end=None, all_paths=True,
neighbours=neighbours, early_out=early_out):
ends.add(path[-1])
total_rating += 1
Expand Down

0 comments on commit 8a45499

Please sign in to comment.