标签:leetcode
题意: https://leetcode.com/problems/unique-paths/public class Solution { public int uniquePaths(int m, int n) { int pathNum = 0; int [][] paths = new int[m+1][n+1]; for(int i = 1; i <= m; i ++){ for(int j = 1; j<= n ; ++j){ if(i == 1 || j == 1) paths[i][j] = 1; else paths[i][j] = paths[i-1][j] + paths[i][j-1]; } } pathNum = paths[m][n]; return pathNum; } }
标签:leetcode
原文地址:http://blog.csdn.net/youmengjiuzhuiba/article/details/44888755