Directi Intern OA

There is an infinite grid. You are given N points on it. 2 points are said to be connected if the manhattan distance between them is equal to 1. We can connect two points with the cost of euclidean distance between them. Find the minimum cost of connecting all points.

It would be better to give approach rather than code.

Comments (2)