Manhattan Meeting Time

Premium Content - Free Preview

You're working on an app that calculates driving time in a city from point A to point B. People drive at 24mph on avenues (along the Y-axis) and 20mph on streets (along the x-axis).

You will be given four integer co-ordinates {x1, y1, x2, y2} in an array, where (x1,y1) and (x2,y2) are points A and B on a 2D grid. Calculate and print the time in minutes it will take to drive from point A to point B.

End of Free Content Preview. Please Sign in or Sign up to buy premium content.


Contact Us
Sign in or email us at [email protected]