A monster chases you into a dungeon, you have a map of the dungeon drawn as an undirected graph. currently you are at the vertex with the only door to the dungeon. you can cross 1 edge per time step, but after the first time step the monster enters the door and after that it also crosses 1 edge per time step, crossing the same sequence of edges you did( so it is always 1 step behind you unless you stop moving). Sketch an efficient algorith that tells you if there's a way you can double back to the door while avoiding the monsters. so you can escape and lock the monster in teh dungeon.
tip for help, tyvm in advance