mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-13 22:35:09 +08:00
添加0062不同路径C#版本
This commit is contained in:
@ -452,5 +452,25 @@ object Solution {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### c#
|
||||||
|
|
||||||
|
```c#
|
||||||
|
public class Solution
|
||||||
|
{
|
||||||
|
public int UniquePaths(int m, int n)
|
||||||
|
{
|
||||||
|
int[] dp = new int[n];
|
||||||
|
for (int i = 0; i < n; i++)
|
||||||
|
dp[i] = 1;
|
||||||
|
for (int i = 1; i < m; i++)
|
||||||
|
for (int j = 1; j < n; j++)
|
||||||
|
dp[j] += dp[j - 1];
|
||||||
|
return dp[n - 1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-----------------------
|
-----------------------
|
||||||
<div align="center"><img src=https://code-thinking.cdn.bcebos.com/pics/01二维码一.jpg width=500> </img></div>
|
<div align="center"><img src=https://code-thinking.cdn.bcebos.com/pics/01二维码一.jpg width=500> </img></div>
|
||||||
|
Reference in New Issue
Block a user