DEV Community

Discussion on: Daily Challenge #289 - Manhattan Distance

Collapse
 
peter279k profile image
peter279k

Here is the simple solution with Python:

def manhattan_distance(pointA, pointB):
    return abs(pointA[0] - pointB[0]) + abs(pointA[1] - pointB[1])