Calculate obstacles in a maze


  • 0
    C

    Given a maze which is a MxN array, some of its cells have obstacles. Put a mouse in any available location (say [X,Y]), it can move to 4 directions, write a program to count how many obstacles in this maze.


  • 0
    C

    I realized that interviewer actually made a mistake. if a maze is MxN and only one cell is empty, in this case it is impossible to get the count of obstacles by traversing. Either he forgot to add some condition or he gave a wrong question.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.