题解 | #走方格的方案数#
走方格的方案数
https://www.nowcoder.com/practice/e2a22f0305eb4f2f9846e7d644dba09b
class Solution: # 动态规划 def uniquePaths(self, m: int, n: int) -> int: dp = [[1 for i in range(n)] for j in range(m)] for i in range(m): for j in range(n): dp[i][j] = dp[i][j - 1] + dp[i - 1][j] return dp[m - 1][n - 1] col,row = input().split() s= Solution() print(s.uniquePaths(int(row),int(col)))