题解 | #求路径#
求路径
http://www.nowcoder.com/practice/166eaff8439d4cd898e3ba933fbc6358
class Solution: def uniquePaths(self , m , n ): # write code here dict = {} for k in range(n): dict[(0,k)] = 1 for v in range(m): dict[(v, 0)] = 1 for i in range(1, m): for j in range(1, n): dict [(i,j)] = dict[(i-1, j)] + dict[(i, j-1)] return dict[(m-1,n-1)]