Skip to content

algorithmshard

Escape the Datacenter

250 points · 0 solved

The first line is R C (1 ≤ R, C ≤ 200). The next R lines are the map: . floor, # rack, S start, E exit (exactly one of each). Moving up, down, left or right costs one step. Print the fewest steps from S to E, or -1 if it's unreachable.

3 4
S..#
.#..
...E
5
Learn the technique/learn/algorithms-data-structures

main.py