public int jump(int[] A) {
		if (A == null)
			return 0;
		int n = A.length;
		if (n <= 1)
			return 0;
		int[] result = new int[n];
		int max = 0;
		int lastmax = 0;
		for (int cur = 0; cur < n; cur++) {
			if (cur + A[cur] >= n - 1)
				return result[lastmax] + 1;
			if (cur + A[cur] > max) {
				max = cur + A[cur];
			}
			if (cur + A[cur] > lastmax) {
				result[cur + A[cur]] = result[lastmax] + 1;
			} else {
				result[cur + A[cur]] = result[lastmax];
			}
			if (cur == lastmax)
				lastmax = max;
		}

		return result[n - 1];
	}