Guest User

Untitled

a guest
Dec 9th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. let answer = coords1_intoXY.filter(coords1 => coords2_intoXY.every(coords2 => {
  2. let x = Number(coords1[0]) - Number(coords2[0])
  3. let y = Number(coords1[1]) - Number[coords2[1]]
  4. return Math.hypot(x, y) < 5
  5. }))
  6.  
  7. return answer.map(coords => coords.join('|'));
Add Comment
Please, Sign In to add comment