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