Given an m x n matrix, return the number of ways to travel from the top-left cell to the bottom-right cell using only right and down moves. Pattern focus: Unique paths. This is the classic path-counting formulation often solved with DP or combinatorics.
m and n are the matrix dimensions
number of monotonic paths
Example 1:
Input:
m = 2 n = 3
Output:
3
Explanation:
A 2x3 matrix has 3 monotonic paths.
Example 2:
Input:
m = 3 n = 3
Output:
6
Explanation:
A 3x3 matrix has 6 monotonic paths.
Example 3:
Input:
m = 4 n = 4
Output:
20
Explanation:
A 4x4 matrix has 20 monotonic paths.