QuestionYou are given an inclusive range[lower, upper]and asorted uniqueinteger arraynums, where all elements are within the inclusive range.A numberxis consideredmissingifxis in the range[lower, upper]andxis not innums.Returntheshortest sortedlist of ranges thatexactly covers all the missing numbers**. That is, no element ofnumsis included in any of the ranges, and each missing number is covered by one of the ranges.Example 1:Input: nums = [0,1,3,50,75], lower = 0, upper = 99
Output: [[2,2],[4,49],[51,74],[76,99]]
Explanation: The ranges are:
[2,2]
[4,49]
[51,74]
[76,99]Example 2:Input: nums
...
继续阅读
(45)