TS/JS Hacks with efficient memory - beats 97.10%
\n# Code\n\nfunction findDifference(nums1: number[], nums2: number[]): number[][] {\n    const len = Math.max(nums1.length, nums2.length)\n\n    const [ans1, an
\n# Code\n```\nfunction findDifference(nums1: number[], nums2: number[]): number[][] {\n    const len = Math.max(nums1.length, nums2.length)\n\n    const [ans1, ans2] = [new Set<number>(), new Set<number>()]\n\n    for(let i = 0; i < len; i++){\n        if(nums1[i] !== undefined){\n            if(!nums2.includes(nums1[i])){\n                ans1.add(nums1[i])\n            }\n        }\n\n        if(nums2[i] !== undefined){\n            if(!nums1.includes(nums2[i])){\n                ans2.add(nums2[i])\n            }\n        }\n    }\n\n    return [Array.from(ans1), Array.from(ans2)]\n};\n```
['TypeScript', 'JavaScript']