Title description: The matrix of m * n, from top left to bottom right, can only go down or to the right, how many ways are there in total;
Problem- solving ideas: typical dynamic programming problems
class Solution {
public:
int uniquePaths(int m, int n)
{
int ways[m][n];
for(int i = 0; i < m; ++i)
{
for(int j = 0; j < n; ++j)
{
if(i == 0 && j == 0)
ways[0][0] = 1;
else if(i == 0)
ways[0][j] = 1;
else if(j == 0)
ways[i][0] = 1;
else
{
ways[i][j] = ways[i - 1][j] + ways[i][j - 1];
}
}
}
return ways[m - 1][n - 1];
}
};