Update0055.跳跃游戏,添加C#

This commit is contained in:
eeee0717
2023-12-29 16:45:31 +08:00
parent 6eadd3eafc
commit e209d35143

View File

@ -258,6 +258,23 @@ object Solution {
}
}
```
### C#
```csharp
public class Solution
{
public bool CanJump(int[] nums)
{
int cover = 0;
if (nums.Length == 1) return true;
for (int i = 0; i <= cover; i++)
{
cover = Math.Max(i + nums[i], cover);
if (cover >= nums.Length - 1) return true;
}
return false;
}
}
```
<p align="center">
<a href="https://programmercarl.com/other/kstar.html" target="_blank">