Rat Maze, is a Backtracking related problem and in this post we will see how we can solve this challenge in C++

there is a rat in a maze.The maze is represented by a 2d matrix with 1 and 0s . 1 means it is possible to go there ,0 means it can't be reached.Find whether there is any path for the rat inside for reaching its destination. The rat can only move forward and down The starting point is the upper left most cell and destination in rightmost cell in the lowest row(bottom most right cell) We use backtracing just like the knight problem

Please check the main.cpp snippet for the solution.

This solution originally posted at: Github by @susantabiswas