@@ -0,0 +1,635 @@
+package greedy;%0A%0A/**%0A * Created by Yue on 2017/11/4.%0A * 665. Non-decreasing Array%0A */%0Apublic class NonDecreasingArray %7B%0A%0A    public static boolean checkPossibility(int%5B%5D nums) %7B%0A        if (nums.length %3C= 2)%0A            return true;%0A        int count = 0;%0A        for (int i = 0; i %3C nums.length - 1 && count %3C= 1; i++) %7B%0A            if (nums%5Bi%5D %3E nums%5Bi + 1%5D) %7B%0A                count++;%0A                nums%5Bi%5D = nums%5Bi + 1%5D;%0A            %7D%0A        %7D%0A        return count %3C= 1;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        int%5B%5D nums = new int%5B%5D %7B3, 4, 2, 3%7D;%0A        System.out.println(checkPossibility(nums));%0A    %7D%0A%7D%0A

665. Non-decreasing Array