@@ -0,0 +1,641 @@
+class Solution:%0A    # @param %7Binteger%5B%5D%7D nums%0A    # @return %7Bstring%5B%5D%7D%0A    def summaryRanges(self, nums):%0A        if not nums:%0A            return nums%0A        result = %5B%5D%0A        start = nums%5B0%5D%0A        for i in range(1, len(nums)):%0A            if nums%5Bi%5D != nums%5Bi-1%5D + 1:%0A                if nums%5Bi-1%5D %3E start:%0A                    result.append(%22%25d-%3E%25d%22 %25 (start, nums%5Bi-1%5D))%0A                else:%0A                    result.append(%22%25d%22 %25 start)%0A                start = nums%5Bi%5D%0A        if start == nums%5B-1%5D:%0A            result.append(%22%25d%22 %25 start)%0A        else:%0A            result.append(%22%25d-%3E%25d%22 %25 (start, nums%5B-1%5D))%0A        return result%0A

solve 228