Advertisement
corzopabloariel

FindIntersection

Apr 7th, 2020
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function FindIntersection(strArr) {
  2.   let [opt1,opt2] = strArr.map(x => x.split(',').map(x => parseInt(x)));
  3.   let s = new Set(opt2);
  4.  
  5.   return opt1.filter(x => s.has(x)).join(',') || 'false';
  6. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement