Skip to content

Commit 28fb96a

Browse files
Feat : Unique Paths
1 parent c3d4fd8 commit 28fb96a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

unique-paths/printjin-gmailcom.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Solution:
2+
def uniquePaths(self, m, n):
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[m - 1][n - 1]

0 commit comments

Comments
 (0)