We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b3cc872 commit 5d5c177Copy full SHA for 5d5c177
1 file changed
0062-unique-paths/0062-unique-paths.py
@@ -0,0 +1,7 @@
1
+class Solution:
2
+ def uniquePaths(self, m: int, n: int) -> int:
3
+ dp = [[1] * n for _ in range(m)]
4
+ for i in range(1, m):
5
+ for j in range(1, n):
6
+ dp[i][j] = dp[i-1][j] + dp[i][j-1]
7
+ return dp[-1][-1]
0 commit comments