Given a sorted array of numbers, return the summary of its ranges.
## Examples
```python
summary_ranges([1, 2, 3, 4]) == ["1->4"]
summary_ranges([1, 1, 1, 1, 1]) == ["1"]
summary_ranges([0, 1, 2, 5, 6, 9]) == ["0->2", "5->6", "9"]
summary_ranges([0, 1, 2, 3, 3, 3, 4, 5, 6, 7]) == ["0->7"]
summary_ranges([0, 1, 2, 3, 3, 3, 4, 4, 5, 6, 7, 7, 9, 9, 10]) == ["0->7", "9->10"]
summary_ranges([-2, 0, 1, 2, 3, 3, 3, 4, 4, 5, 6, 7, 7, 9, 9, 10, 12]) == ["-2", "0->7", "9->10", "12"]
```
def summary_ranges(a):
    a,i,li = sorted(set(a), key=a.index),0,[]
    while i < len(a):
        temp = [a[i]] ; i += 1
        while i < len(a) and temp[-1] + 1 == a[i] : temp.append(a[i]) ; i += 1
        li.append(temp)
    return [f"{i[0]}->{i[-1]}" if len(i) > 1 else f"{i[0]}" for i in li]
def summary_ranges(a):
    a,i,li = sorted(set(a), key=a.index),0,[]
    while i < len(a):
        temp = [a[i]] ; i += 1
        while i < len(a) and temp[-1] + 1 == a[i] : temp.append(a[i]) ; i += 1
        li.append(temp)
    return [f"{i[0]}->{i[-1]}" if len(i) > 1 else f"{i[0]}" for i in li]