Back to problems

Compute maze score using shortest path

Algorithm · Airbnb · Medium

In this problem, the maze is a rectangular grid supplied as a list of strings maze with R rows and C columns. Each cell holds one of four characters: '#' for an impassable wall, '.' for an open square, 'S' for the unique starting square, and 'E' for the unique goal square. The score of the maze is the minimum number of steps required to travel from 'S' to 'E'. From any square you may move to an adjacent square in one of the four cardinal directions, but you cannot move into…

Checking your access…