@@ -0,0 +1,1095 @@
+/***%0A * Given a non-negative number represented as an array of digits, plus one to the number.%0A *%0A * The digits are stored such that the most significant digit is at the head of the list.%0A */%0Apublic class Solution %7B%0A    public int%5B%5D plusOne(int%5B%5D digits) %7B%0A        int n = digits.length;%0A        if (n == 0)%0A            return null;%0A        int addup = 0;%0A        if (digits%5Bn - 1%5D + addup + 1 %3E= 10) %7B%0A            digits%5Bn - 1%5D += addup + 1 - 10;%0A            addup = 1;%0A        %7D else %7B%0A            digits%5Bn - 1%5D += addup + 1;%0A            addup = 0;%0A        %7D%0A%0A        for (int i = n - 2; i %3E= 0; i--)%7B%0A            if (digits%5Bi%5D + addup %3E= 10) %7B%0A                digits%5Bi%5D += addup - 10;%0A                addup = 1;%0A            %7D else %7B%0A                digits%5Bi%5D += addup;%0A                addup = 0;%0A            %7D%0A        %7D%0A%0A        if (addup == 1) %7B%0A            int newdigits%5B%5D = new int%5Bn + 1%5D;%0A            newdigits%5B0%5D = 1;%0A            for (int i = 2; i %3C= n; i++)%0A                newdigits%5Bi%5D = digits%5Bi - 1%5D;%0A            return newdigits;%0A        %7D else%0A            return digits;%0A%0A    %7D%0A%7D%0A%0A

add PlusOne.java