https://leetcode.com/problems/check-if-all-the-integers-in-a-range-are-covered/



Runtime: 142 ms, faster than 7.14% of TypeScript online submissions for Check if All the Integers in a Range Are Covered.

Memory Usage: 48.9 MB, less than 21.43% of TypeScript online submissions for Check if All the Integers in a Range Are Covered.



```typescript
function getRangeNumberList(left: number, right: number): number[] {
    let tempArray = []
    for (let i=left; i <= right; ++i) {
        tempArray.push(i)
    }
    return tempArray
}

function isCovered(ranges: number[][], left: number, right: number): boolean {
    //8:07
    let bigArray = []
    for (const range of ranges) {
        let startNum = range[0]
        let endNum = range[1]
        bigArray = [...bigArray, ...getRangeNumberList(startNum, endNum)]
    }
    let bigSet = new Set(bigArray)
    
    let needToCheckList = getRangeNumberList(left, right)
    for (const num of needToCheckList) {
        if (!bigSet.has(num)) {
            return false
        }
    }
    return true
    //8:13
};
```
