public static int jump_greedy(int[] A) {
        // try greedy
        if(A==null || A.length<=1) return 0;
        int cnt = 0;
        int start = 0;
        int end = 0;
        while(true) {
            int curMaxEnd=end;
            cnt++;
            for(int i=start;i<=end;++i) {
                if((A[i]+i)>curMaxEnd) curMaxEnd=A[i]+i;
                if(curMaxEnd>= A.length-1) return cnt;
            }
            start = end+1;
            end = curMaxEnd;
            if(end<start) return -1;
        }
    }