function findMissing(arr1, arr2) {
let str = arr1.filter(i => !arr2.includes(i)).join('');
return Number(str);
}
Test.assertEquals(findMissing([1, 2, 3], [1, 3]), 2);
Test.assertEquals(findMissing([6, 1, 3, 6, 8, 2], [3, 6, 6, 1, 2]), 8);
Test.assertEquals(findMissing([7], []), 7);
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter