DEV Community

Discussion on: Daily Challenge #289 - Manhattan Distance

Collapse
 
qm3ster profile image
Mihail Malo

JavaScript

const manhattan = ([x1, y1], [x2, y2]) => Math.abs(x2-x1) + Math.abs(y2-y1)