```
class Solution {
public:
bool canJump(int A[], int n) {
if(n == 0 || n == 1)
return true;
int* b = (int*)malloc(n*sizeof(int));
int i;
for(i = 0; i < n - 1; i++) // A[n-1] is left out
{
b[i] = A[i] + i;
}
bool found;
int j;
for(i = 0; i < A[0]; i++)
{
j = i;
while(j < n - 1)
{
if(j < b[j])
j = b[j];
else
{
found = false;
break;
}
}
if(j >= n -1)
{
found = true;
break;
}
}
return found;
}
};
```

The 1 1 2 2 0 1 1 should return true.

This code return false and got accepted.