← 返回 meta 的题目列表Find Missing Ranges
类型:online_judge
Given a range [0, 99] and a sorted integer array, e.g., [2, 4, 7, 12, 20], find the missing ranges. The result should include single numbers or consecutive missing numbers as ranges, such as [0,1, 3, 5, 6, 8-11, 13-19, 21-99]. Assume the input is guaranteed to be within the range from 0 to 99.
Example
Input
[2, 4, 7, 12, 20]