Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution(object):
- def uniquePaths(self, m, n):
- """
- :type m: int
- :type n: int
- :rtype: int
- """
- mat = [[1]*n]*m
- for i in range(m):
- for j in range(n):
- if i > 0 and j > 0:
- mat[i][j] = mat[i-1][j] + mat[i][j-1]
- return mat[i][j]
Add Comment
Please, Sign In to add comment