Skip to content

Latest commit

 

History

History

manhattan-distance

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Requirements

Manhattan distance is the distance between two points in a grid (like the grid-like street geography of the New York borough of Manhattan) calculated by only taking a vertical and/or horizontal path.

Write a function int manhattanDistance(Point, Point) that returns the Manhattan Distance between the two points.

Additional rules

  • The class Point is immutable (its state cannot be changed after instantiation)
  • The class Point has no getters
  • The class Point has no public properties (i.e. the internal state cannot be read from outside the class).