A warehouse robot moves up, down, left or right on a grid. # is a wall, . is open floor, S is the start and E is the exit.
Implement shortest_path(grid) for a list of equal-length strings. Return the number of moves on the shortest route from S to E, or -1 if there isn't one. Then implement shortest_route(grid) returning the list of (row, col) cells on one shortest route, from S to E inclusive, or []. When several routes tie, explore neighbours in the order up, down, left, right.