【Leetcode 228】Summary Ranges
难度: 简单(Easy)
题目
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”].
思路
用两个指针来确定一个区间
代码
1 | class Solution(object): |
难度: 简单(Easy)
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”].
用两个指针来确定一个区间
1 | class Solution(object): |
评论系统未开启,无法评论!