62. Unique Paths
Medium — Dynamic Programming
2D DP
1D Rolling
m:
2
3
4
5
6
7
8
n:
2
3
4
5
6
7
8
Apply
Play
Pause
Step
Reset
Speed:
Slow
Normal
Fast
Very Fast
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)