给出一个排序的唯一整数数组nums.一个范围 [a,b] 是从a到b (包括) 的所有整数的集合.返回最小的排序列表,覆盖数组中的所有数字.即,nums的每个元素被其中一个范围覆盖,并且没有整数x,这样x在其中一个范围中,但不是nums.列表中的每个范围 [a,b]应输出为: "a->b"如果a!= b "a"如果a == b
To solve this problem, you can iterate through the nums array and keep track of the current range using two variables. When there is a gap between adjacent numbers, you can add the previous range to the result list and update the range to start from the current number.

At the end of the iteration, you need to add the last range to the result list. Here's the code:

```
def summaryRanges(nums):
    n = len(nums)
    if n == 0:
        return []
    res = []
    start = nums[0]
    for i in range(1, n):
        if nums[i] == nums[i-1] + 1:
            continue
        else:
            if start == nums[i-1]:
                res.append(str(start))
            else:
                res.append(str(start) + '->' + str(nums[i-1]))
            start = nums[i]
    if start == nums[n-1]:
        res.append(str(start))
    else:
        res.append(str(start) + '->' + str(nums[n-1]))
    return res
```