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

Commit e209d35

Browse files
committed
Update0055.跳跃游戏,添加C#
1 parent 6eadd3e commit e209d35

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

‎problems/0055.跳跃游戏.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,23 @@ object Solution {
258258
}
259259
}
260260
```
261+
### C#
262+
```csharp
263+
public class Solution
264+
{
265+
public bool CanJump(int[] nums)
266+
{
267+
int cover = 0;
268+
if (nums.Length == 1) return true;
269+
for (int i = 0; i <= cover; i++)
270+
{
271+
cover = Math.Max(i + nums[i], cover);
272+
if (cover >= nums.Length - 1) return true;
273+
}
274+
return false;
275+
}
276+
}
277+
```
261278

262279
<p align="center">
263280
<a href="https://programmercarl.com/other/kstar.html" target="_blank">

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /