Question: Based on this approach on how to obtain data from extracting it from line Provide a code for the following problem following the same method
Based on this approach on how to obtain data from extracting it from "line"

Provide a code for the following problem following the same method of extracting data.

You are given a grid, denoted a, of n rows and m columns. Initially, you start at cell (1,1). At any instance, you can either move to cell (i+1,j) or cell (i,j+1), but you cannot move into a cell with an obstacle or stay in the same cell. Count the number of ways to reach cell (n,m). It is said that cell (i,j) contains an obstacle if a[i][j]=1. Input The first line of input contains two space seperated integers n and m(1n+m12) The following n lines contain m space seperated integers where the ith row and jth column is the value of a[i][j]. It is guaranteed that cells (1,1) and (n,m) do not have obstacles. Output A single integer - the number of ways to reach cell (n,m) Examples 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
