easy understand python DP solution O(n) space

  • 0
    def uniquePaths(self,m,n):
            for i in range(1,m):
                for j in range(1,n):
            return dp[-1]

    Basic idea is that the new dp[j] is decided by original dp[j] (its top), and new dp[j-1] (its left)

Log in to reply

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