Solved 2013-PacNW/Escape (BFS + PriorityQueue)