We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 863450b commit 634da85Copy full SHA for 634da85
src/main/java/g0001_0100/s0045_jump_game_ii/Solution.java
@@ -4,15 +4,15 @@
4
// #Algorithm_II_Day_13_Dynamic_Programming #Dynamic_Programming_I_Day_4
5
// #Big_O_Time_O(n)_Space_O(1) #2024_11_10_Time_0_ms_(100.00%)_Space_44.9_MB_(75.73%)
6
7
-class Solution {
+public class Solution {
8
public int jump(int[] nums) {
9
if (nums.length == 1) {
10
return 0;
11
}
12
return minJumps(nums, 0, 0);
13
14
15
- private static int minJumps(int[] nums, int currIndex, int jumpStatus) {
+ private int minJumps(int[] nums, int currIndex, int jumpStatus) {
16
if (currIndex + nums[currIndex] >= nums.length - 1) {
17
return jumpStatus + 1;
18
0 commit comments