62. Unique Paths

Medium — Dynamic Programming

2D DP
1D Rolling
Press "Play" or "Step" to fill the DP table.

Step

0 / 0

Cell

(0,0)

Formula

--

Result

--
Current cell
Above (from up)
Left (from left)
Filled
Algorithm Complexity
Recursion
O(2^(m+n))
Time / Space: O(2^(m+n)) / O(m+n)
DP 2D
O(mn) / O(mn)
Time / Space: O(mn) / O(mn)
DP 1D
O(mn) / O(n)
Time / Space: O(mn) / O(n)
Combinatorics
O(min(m,n))
Time / Space: O(min(m,n)) / O(1)