Just 5 line solution


#1

`int solve(vector &arr)
{

int n = arr.size();
int indexTill = 0;
for (int i = 0; i < n; i++)
{
    if (i > indexTill) break;
    indexTill = max(indexTill, arr[i] + i);
    indexTill = min(indexTill, n - 1);
}
return indexTill == n-1;

}`