This repository has been archived on 2026-10-01. You can view files and clone it, but cannot push or open issues or pull requests.
2026-rff_mp/MusinAA/task2/strategyObjects/util.py

12 lines
340 B
Python

from task2.mazeObjects.maze import Maze
from task2.mazeObjects.cell import Cell
def restorePath(parents: dict, exit: Cell) -> list[Cell]|None:
path = []
current = exit
while current:
path.append(current)
if current not in parents:
return None
current = parents[current]
return path[::-1]