Booking.com interview question

HackerRank: average of point using Manhattan distance