2x2 grid
Input
rows=2, cols=2
Output
2
Two paths: right->down or down->right.
Full lesson preview
Count distinct paths from top-left to bottom-right moving only right or down using recursion with memoization.
Problem statement
Task
Examples
Input
rows=2, cols=2
Output
2
Two paths: right->down or down->right.
Input format
Output format
Constraints
Samples
Input
rows=3, cols=3
Output
6
Paths count equals binomial coefficient C(4,2) = 6.