public int jump(int[] A) {
		int steps = 0, max = 0, next = 0;
		for (int i = 0; i < A.length - 1 && next < A.length - 1; i++) {
			max = Math.max(max, i + A[i]);
			if (i == next) { // ready to jump
				if (max == next)
					return -1; // unreachable
				next = max;
				steps++;
			}
		}
		return steps;
	}