class Solution {
public int jump(int[] nums) {
int edge = 0, max = 0, step = 0;
for (int i = 0; i < nums.length - 1; i++){
max = Math.max(max, i + nums[i]);
if (i == edge){
edge = max;
step++;
}
}
return step;
}
}