| Algorithm 1: Get the evacuation path |
| Input: , , , Output: An array with each of the positions (x, y) where the person walks () , , = b’0’, b’*’, b’e’ = collections.deque([[]]) = set([]) repeat = .popleft() x, y = [-1] if [y][x] == then return end repeat if 0 <= < and 0 <= < and [][] != and (, ) not in then .append( + [(, )]) .add((, )) end until , in ((x+1,y), (x-1,y), (x,y+1), (x,y-1); until ; |