Gray blocks represent dead ends (value = 0) and path can be traced only using the white path (value = 1).
The binary matrix representation of the above maze (a) is given as
{1, 0, 0, 0}n{1, 0, 0, 0}n{1, 1, 1, 1}n{0, 0, 0, 1}n
The highlighted lines in (b) show the path to reach the destination from the source.
1. If the destination point is reached,
2. Else
@@coding::1@@
Recommended Programs