```
class Solution {
public:
int jump(vector<int>& nums) {
if(nums.size() < 2) return 0;
int level = 0;
int start = 0;
int end = start + 1;
while(end < nums.size()){
int nextEnd = end;
for(int i = start; i < end; i++){
nextEnd = max(nextEnd, i + nums[i]);
}
level++;
start = end;
end = nextEnd + 1;
}
return level;
}
};
```