https://leetcode.com/problems/find-the-difference-of-two-arrays/


Runtime: 202 ms, faster than 43.86% of TypeScript online submissions for Find the Difference of Two Arrays.

Memory Usage: 49.5 MB, less than 54.39% of TypeScript online submissions for Find the Difference of Two Arrays.


```typescript
function findDifference(nums1: number[], nums2: number[]): number[][] {
    //9:34
    const a = new Map();
    const b = new Map();
    
    for (const num of nums1) {
        if (!nums2.includes(num)) {
            if (!a.has(num)) {
                a.set(num, num)
            }
        }
    }
    
    for (const num of nums2) {
        if (!nums1.includes(num)) {
            if (!b.has(num)) {
                b.set(num, num)
            }
        }
    }
    
    return [
        [...a.keys()],
        [...b.keys()]
    ]
    //9:37
};
```
