narendra
BAN USER- 0of 0 votes
AnswerYou are in a maze, and you need to find all possible path from an entrance to an exit. Here are the constraints: ● The maze is represented by a 2D grid. ● Spots that you can step on are represented by a 0. ● Pits that you will fall into (aka spots that you cannot step on) are represented by a 1. ● The entrance is represented by a 2. ● The exit is represented by a 3. ● Each path can only have two endpoints; entrance and exit. You cannot use the entrance or exit more than once for each path. ● You have to step on every spot exactly once. ● You can only move like a King in chess (horizontally or vertically but not diagonally)
- narendra in India
Here is an example of the maze: 2 0 0 0 0 0 0 0 0 0 0 0 0 3 1 Possible paths are:
Your program should read from standard input with a series of integers with whitespace as delimiter. The first two integer represents the width and height of the maze. It will then be followed by width*height more integers. Your output should be an integer which shows the total number of possible path. Marks will be given for efficiency as well.| Report Duplicate | Flag | PURGE
Java Developer