Skip to content

wasswarichard/labyrinth

Repository files navigation

Labyrinth

Find the shortest path from the start ("S") to the exit ("E"). Movement is allowed only in four directions: up, down, left, and right. You need to return the length of the shortest path from "S" to "E". If no path exists, return -1.

Testing the solution

To use the tests, you will need to install Node -- you can do this via the download page or using Homebrew if you are on a Mac.

You can clone or download this repo. Once you have done so, from the root directory of the repo, run:

    npm install
    npm start

To run the tests

    npm run test

Test cases snapshot

Snapshot of test cases

Thanks for your time :)