
vector<string> summaryRanges(vector<int>& nums)
{
int nums_len = nums.size();
vector<string> res;
if (nums_len == )
return res; for (int i = ; i < nums_len;) {
int start = i, end = i;
while (end + < nums_len && nums[end + ] == nums[end] + ) end++;
if (end > start)
res.push_back(to_string(nums[start]) + "->" + to_string(nums[end]));
else
res.push_back(to_string(nums[start]));
i = end + ;
}
return res;
}