AlgoUniversity
  • Go Back
Discussion
Paths To Reach :

Author

Akshay Sharma

Difficulty Level : Hard

Submissions : 199

Asked In : Rippling

Marks :100

: 1 | : 1

Given an N*M cross, matrix to find out no of possible ways to reach N, M cell from the cell 1,1 Given that some cells should not be visited in the grid the cell that is marked with 1 should not be visited all the cells that are marked with 0 are visitable cells. Find the total number of unique paths from (1,1) to (M,N)

If and is too large print ans

Input

The first line of input contains two integer N,M ($$$1 \le N,M \le 100 $$$).

The next N*M lines contain a matrix that contains 0 and 1.

Output

For each test case print the total number of unique paths.

Example

Input
3 3 
0 0 0
0 1 0 
0 0 0
Output
2

You need to login to view your submissions.

You need to login to view all submissions.

Loading...

Result : Executed

Loading...

Feel something is wrong with the test cases?

Result : Accepted

Test Cases :

You need to Log In
We're glad that you want to attempt this problem!

But to Run or Submit the Problem, you need to Log In.

Continue to Log In
Challenge Submitted!

Your challenge has been submitted successfully.

You will get a response soon via WhatsApp or Email.

Challenge
Facing issue while trying to solve the problem! Don't worry, we got you covered!

Do let us know your issue.

Looks good!
Please enter your issue / feedback.

How do we get in touch with you?
Looks good!
Please enter your phone no.
Looks good!
Please enter your email address.