Count Paths in Grid with Blocks

JavaScript Hard 5 views
Back to Questions

Problem Description

You are given a grid with 0 (free) and 1 (blocked). You can move only right or down. Count number of ways from top-left to bottom-right modulo 1000000007.

Input Format

First line: r c. Next r lines: c numbers (0/1).

Output Format

One integer ways mod 1e9+7.

Sample Test Case

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

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next