https://leetcode.com/problems/summary-ranges


Runtime: 28 ms, faster than 81.70% of Python3 online submissions for Summary Ranges.
Memory Usage: 14.4 MB, less than 16.69% of Python3 online submissions for Summary Ranges.


```python
class Solution:
    def summaryRanges(self, nums: List[int]) -> List[str]:
        #9:00
        ranges = []
        length = len(nums) - 1
        
        if (length == 0):
            return [f"{nums[0]}"]
        
        range_start = None
        range_end = None
        for index, current in enumerate(nums):
            if (index != length):
                next = nums[index + 1]
                if (current + 1 == next):
                    if (range_start == None):
                        range_start = current
                        if (index == length-1):
                            ranges.append(f"{current}->{next}")
                    else:
                        range_end = next
                        if (index == length-1):
                            ranges.append(f"{range_start}->{next}")
                else:
                    if range_end == None:
                        if (range_start != None and range_start != current):
                            ranges.append(f"{range_start}->{current}")
                        else:
                            ranges.append(f"{current}")
                        if (index == length-1):
                            ranges.append(f"{next}")
                        range_start = None
                    if range_end != None:
                        ranges.append(f"{range_start}->{range_end}")
                        range_start = next
                        range_end = None
                        #print(current, next)
                        if (index == length-1):
                            ranges.append(f"{next}")
        #9:07
        #debug until 9:50
        return ranges
```