public boolean canJump(int[] A) {// O(n) time and O(1) space
		int next = A.length - 1;
		for (int i = A.length - 2; i >= 0; --i) {
			if (A[i] >= (next - i)) {
				next = i;
			}
		}
		return (next == 0);
	}