April 2024
Intermediate to advanced
632 pages
17h 38m
English
Input: Given a maze of size N X M with some obstacles.
Description: A cell in the maze is said to be blocked if its value is -1. 0 represents a free or non-blocked cell. No path is possible through a blocked cell. At every cell, we can move either down or towards the right.
Goal: Count the total number of unique paths from the top-left corner of the maze to the bottom-right corner.
Example:
Note that path through the cell[1][1] is not possible as it is blocked. Therefore, we will just count every other valid path that does not include the cell[1][1].
Recursive solution:
Input: A maze with two variables N ...
Read now
Unlock full access