This algorithm is an O(n^2) solution to the problem of exiting a maze with one-way doors.