A simulation problem. We simple walk through all reachable items until we cannot proceed.
class Solution { public: bool canJump(int A[], int n) { int MaxInx = 0; int inx = 0; while (inx < n && inx <= MaxInx) { MaxInx = std::max(MaxInx, A[inx] + inx); if (MaxInx >= n - 1) return true; inx++; } return false; } };