Want to solve this problem? Login now to get access to solve the problems

Problem

Submissions

Solution

Leaderboard

Coming soon

3

Difficulty: MEDIUM

Avg. time to solve

25 min

Success Rate

70%

Problem Statement

Suggest Edit

```
There are two possible scenarios when a turn can occur at point (i, j):
Turns Right: (i-1, j) -> (i, j) -> (i, j+1)
Turns Down: (i, j-1) -> (i, j) -> (i+1, j)
```

```
The answer should be in the mod(10^9+7)
```

```
Line 1 : Number of rows N in the matrix
Line 2 : Number of cols M in the matrix
Line 3 : Maximum turns allowed K
```

```
Return number of paths
```

```
1 <= N <= 10^2
1 <= M <= 10^2
1 <= K <= 200
```

```
3
3
2
```

```
4
```

```
Paths with 0 turn = 0
Paths with 1 turn = 2
Paths with 2 turns = 2
```

Want to solve this problem? Login now to get access to solve the problems