You are viewing a single comment's thread. Return to all comments →
Typescript
function missingNumbers(arr: number[], brr: number[]): number[] { arr.sort((a, b) => a - b); brr.sort((a, b) => a - b); let set = new Set(); let counter = 0; for (let i = 0; i < brr.length; i++) { if (arr[counter] !== brr[i]) { set.add(brr[i]); continue; } counter++; } return Array.from(set.values()) as number[]; }
Seems like cookies are disabled on this browser, please enable them to open this website
Missing Numbers
You are viewing a single comment's thread. Return to all comments →
Typescript