@@ -0,0 +1,730 @@
+package com.zhangjikai.greedy;%0A%0A/**%0A * Created by Jikai Zhang on 2017/6/29.%0A */%0Apublic class JumpGame2 %7B%0A%0A    public int jump(int%5B%5D nums) %7B%0A        if (nums.length == 1) %7B%0A            return 0;%0A        %7D%0A        int maxDis = nums%5B0%5D;%0A        int jumpCount = 1;%0A        int start = 0, end = 0;%0A%0A        while (maxDis %3C nums.length - 1) %7B%0A            end = maxDis;%0A            for (int i = start; i %3C= end; i++) %7B%0A                maxDis = Math.max(maxDis, nums%5Bi%5D + i);%0A            %7D%0A            start = end + 1;%0A            jumpCount++;%0A%0A%0A        %7D%0A        return jumpCount;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        System.out.println(new JumpGame2().jump(new int%5B%5D%7B2,3,2,4,1,3,1,2,4,5,1,2,3,1,2,3,4%7D));%0A    %7D%0A%7D%0A

add jump game