Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit08d2884

Browse files
authored
Merge pull requestneetcode-gh#1087 from agnihotriketan/patch-27
Create 62-Unique-Paths.cs
2 parents1522e30 +e8a7658 commit08d2884

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

‎csharp/62-Unique-Paths.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
publicclassSolution{
2+
publicintUniquePaths(intm,intn){
3+
varrow=newint[n];
4+
Array.Fill(row,1);
5+
foreach(variinEnumerable.Range(0,m-1))
6+
{
7+
varnewRow=newint[n];
8+
Array.Fill(newRow,1);
9+
for(intj=n-2;j>=0;j--)
10+
{
11+
newRow[j]=newRow[j+1]+row[j];
12+
}
13+
row=newRow;
14+
}
15+
returnrow[0];
16+
}
17+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp