class Solution {
public:
/**
*
* @param m int整型
* @param n int整型
* @return int整型
*/
int uniquePaths(int m, int n) {
// write code here
int a[100][100];
for(int i =0;i<m;i++)
{
a[i][0]=1;
}
for(int i =0;i<n;i++)
{
a[0][i]=1;
}
for(int i =1;i<=m-1;i++)
{
for(int j = 1;j<=n-1;j++)
{
a[i][j]=(a[i-1][j]+a[i][j-1]);
}
}
return a[m-1][n-1];
}
};
京公网安备 11010502036488号