Skip to content

Latest commit

 

History

History

validating-a-maze-path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Validating a maze path

Validate the provided maze path is correct.

e.g.:

Maze matrix

[
  [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
  [1, 0, 1, 0, 1, 0, 0, 0, 1, 1],
  [1, 0, 1, 0, 1, 0, 1, 0, 0, 1],
  [1, 0, 1, 0, 1, 1, 1, 1, 0, 1],
  [1, 0, 1, 0, 0, 0, 0, 1, 0, 1],
  [1, 0, 1, 0, 1, 0, 1, 1, 0, 1],
  [1, 0, 0, 0, 1, 0, 0, 1, 0, 1],
  [1, 0, 1, 1, 1, 1, 0, 0, 0, 1],
  [1, 0, 1, 0, 0, 0, 0, 1, 0, 1],
  [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
]

Input

startRow = 1
startCol = 1
destRow = 2
destCol = 5

Output

true

Execute

node solution.js