summary-ranges-228
problem
Given a sorted integer array without duplicates, return the summary of its ranges.
For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"].
题解
每一个区间的起点nums[i]加上j是否等于nums[i+j]
参考
Code
1 | class Solution { |
Given a sorted integer array without duplicates, return the summary of its ranges.
For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"].
每一个区间的起点nums[i]加上j是否等于nums[i+j]
参考
1 | class Solution { |