public int jump(int[] A) {

    if (A == null) {
      return 0;
    }
    int len = A.length;
    if (len == 0 || len == 1) {
      return 0;
    }

    int cur = 0;
    int next = 0;
    int ret = 0;

    for (int i = 0 ; i < len ; i++) {
      if (i > cur) {
        cur = next;
        ret++;
      }
      next = Math.max(next, i + A[i]);
    }
    return ret;
  }