Introduction
In this challenge, we will implement an algorithm to move a robot from the upper left corner to the bottom right corner of a rectangular grid. The robot can only move right and down, and some cells may be off-limits.
In this challenge, we will implement an algorithm to move a robot from the upper left corner to the bottom right corner of a rectangular grid. The robot can only move right and down, and some cells may be off-limits.
Given a rectangular grid with valid and invalid cells, implement a function to find a valid path for the robot to move from the upper left corner to the bottom right corner. If there is no valid path, return None. If the input is invalid or the matrix is empty, return None.
The requirements for this algorithm are as follows:
Consider the following grid:
o = valid cell
x = invalid cell
0 1 2 3
0 o o o o
1 o x o o
2 o o x o
3 x o o o
4 o o x o
5 o o o x
6 o x o x
7 o x o o
expected = [(0, 0), (1, 0), (2, 0),
(2, 1), (3, 1), (4, 1),
(5, 1), (5, 2), (6, 2),
(7, 2), (7, 3)]
In this challenge, we implemented an algorithm to move a robot from the upper left corner to the bottom right corner of a rectangular grid. The robot can only move right and down, and some cells may be off-limits. We also defined the requirements for the algorithm and provided example usage scenarios.