@@ -0,0 +1,893 @@
+package leetcode;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A/**%0A * https://leetcode.com/problems/summary-ranges/%0A */%0Apublic class Problem228 %7B%0A    public List%3CString%3E summaryRanges(int%5B%5D nums) %7B%0A        List%3CString%3E result = new ArrayList%3C%3E();%0A        if (nums.length == 0) %7B%0A            return result;%0A        %7D%0A        int n = nums%5B0%5D;%0A        int tmp = n;%0A        for (int i = 1; i %3C nums.length; i++) %7B%0A            if (tmp+1 != nums%5Bi%5D) %7B%0A                if (n == tmp) %7B%0A                    result.add(%22%22 + n);%0A                %7D else %7B%0A                    result.add(n + %22-%3E%22 + tmp);%0A                %7D%0A                n = nums%5Bi%5D;%0A                tmp = n;%0A            %7D else %7B%0A                tmp++;%0A            %7D%0A        %7D%0A        if (n == tmp) %7B%0A            result.add(%22%22 + n);%0A        %7D else %7B%0A            result.add(n + %22-%3E%22 + tmp);%0A        %7D%0A        return result;%0A    %7D%0A%7D%0A

Solve problem 228