My very simple python solution


  • 0
    J
    def uniquePaths(self, m, n):
        matrix=[[1]*n]*m
        for i in range(1,m):
            for j in range(1,n):
                matrix[i][j]=matrix[i-1][j]+matrix[i][j-1]
        return matrix[-1][-1]

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.