https://leetcode.com/problems/summary-ranges/description/
228. Summary Ranges
给你一个有序整数阵列,如果相邻的元素是连续的将他们合并,例如:[1,2,3] ==>
[1,3],并把合并过的阵列 [a,b] 依照下列格式转成字串:
"a->b" if a != b
"a" if a == b
Example 1:
Input: nums = [0,1,2,4,5,7]
Output: ["0->2","4->5","7"]
Explanation: The ranges are:
[0,2]