Bug Report for https://neetcode.io/problems/intersection-of-two-arrays
class Solution {
/**
* @param {number[]} nums1
* @param {number[]} nums2
* @return {number[]}
*/
intersection(nums1, nums2) {
const nums1Set = new Set(nums1);
const nums2Set = new Set(nums2);
const intersection = nums1Set.intersection(nums2Set);
return intersection;
}
}
Returns the error:
TypeError: arr1.slice is not a function
at TestSolution.isValid (/box/main.js:40:14)
at processInput (/box/main.js:95:30)
at ReadStream.<anonymous> (/box/main.js:60:9)
at ReadStream.emit (node:events:519:28)
at endReadableNT (node:internal/streams/readable:1698:12)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
Using the other 2026 Set methods return similar errors. These are supported by Node 22. The JS item in the language dropdown states it's using Node 22.08.
Bug Report for https://neetcode.io/problems/intersection-of-two-arrays
Returns the error:
Using the other 2026
Setmethods return similar errors. These are supported by Node 22. The JS item in the language dropdown states it's using Node 22.08.