class Solution: def uniquePaths(self, m: int, n: int) -> int: memo=[[0 for i in range(n)] for i in range(m)]#定义空二维数组 for i in range(n): memo[0][i]=1 for j in range(m): memo[j][0]=1 for i in range(1,m): for j in range(1,n): memo[i][j]=memo[i-1][j]+memo[i][j-1] return memo[m-1][n-1]
——2019.10.14
原文:https://www.cnblogs.com/taoyuxin/p/11672917.html