Correct Explanation


#1

the actual task is to find whether we can reach the bottom rightmost cell or not. if yes then return the total length of the path to reach else return -1.