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.
1 parent 2521eb6 commit 72668e7Copy full SHA for 72668e7
unique-paths/devyejin.py
@@ -0,0 +1,11 @@
1
+# 시간 복잡도 O(mn), 공간복잡도 O(mn)
2
+class Solution:
3
+ def uniquePaths(self, m: int, n: int) -> int:
4
+ dp = [[1] * n for _ in range(m)]
5
+
6
+ for i in range(1, m):
7
+ for j in range(1, n):
8
+ dp[i][j] = dp[i - 1][j] + dp[i][j - 1]
9
10
+ return dp[m - 1][n - 1]
11
0 commit comments