We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 393ad81 + 0a8f03c commit 67744a4Copy full SHA for 67744a4
Solution/62. Unique Paths/62. Unique Paths.py
@@ -0,0 +1,11 @@
1
+class Solution:
2
+ def uniquePaths(self, m: int, n: int) -> int:
3
+ f = [[0] * n for _ in range(m)]
4
+ f[0][0] = 1
5
+ for i in range(m):
6
+ for j in range(n):
7
+ if i:
8
+ f[i][j] += f[i - 1][j]
9
+ if j:
10
+ f[i][j] += f[i][j - 1]
11
+ return f[-1][-1]
0 commit comments