Skip to content

Commit

Permalink
Merge pull request youngyangyang04#889 from hailincai/patch1101_02
Browse files Browse the repository at this point in the history
0055 修改代码初始覆盖范围的值和注释
  • Loading branch information
youngyangyang04 committed Nov 9, 2021
2 parents c6fadbd + 22b77d6 commit d3d5ad9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions problems/0055.跳跃游戏.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ class Solution {
if (nums.length == 1) {
return true;
}
//覆盖范围
int coverRange = nums[0];
//覆盖范围, 初始覆盖范围应该是0,因为下面的迭代是从下标0开始的
int coverRange = 0;
//在覆盖范围内更新最大的覆盖范围
for (int i = 0; i <= coverRange; i++) {
coverRange = Math.max(coverRange, i + nums[i]);
Expand Down

0 comments on commit d3d5ad9

Please sign in to comment.