Problem
You get an inclusive range [lower, upper] and a sorted, unique list nums whose values all lie inside it. Return the shortest sorted list of ranges that covers every number in [lower, upper] that is missing from nums. Each range is a pair [a, b]; a single missing number x is [x, x].
Example 1
nums = [0, 1, 3, 50, 75], lower = 0, upper = 99
Example 2
→ [[2, 2], [4, 49], [51, 74], [76, 99]]
Example 3
- Input
- nums = [], lower = 1, upper = 1
- Output
- [[1, 1]]
Example 4
- Input
- nums = [-1], lower = -1, upper = -1
- Output
- []
Constraints
-10^9 <= lower <= upper <= 10^90 <= nums.length <= 100lower <= nums[i] <= upper, and the values are unique and sorted.