8000 refactor 45 again · masiht/Leetcode@c550ab3 · GitHub
[go: up one dir, main page]

Skip to content < 8000 span data-view-component="true" class="progress-pjax-loader Progress position-fixed width-full">

Commit c550ab3

Browse files
refactor 45 again
1 parent 0243d80 commit c550ab3

File tree

1 file changed

+3
-3
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+3
-3
lines changed

src/main/java/com/fishercoder/solutions/_45.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
public class _45 {
1919

2020
public static class Solution1 {
21-
7781 public int jump(int[] A) {
21+
public int jump(int[] nums) {
2222
int stepCount = 0;
2323
int lastJumpMax = 0;
2424
int currentJumpMax = 0;
25-
for (int i = 0; i < A.length - 1; i++) {
26-
currentJumpMax = Math.max(currentJumpMax, i + A[i]);
25+
for (int i = 0; i < nums.length - 1; i++) {
26+
currentJumpMax = Math.max(currentJumpMax, i + nums[i]);
2727
if (i == lastJumpMax) {
2828
stepCount++;
2929
lastJumpMax = currentJumpMax;

0 commit comments

Comments
 (0)
0