#3464
Maximize the Distance Between Points on a Square
international master · 2140 · lc hard +32 · 23.6% accepted · 41 likes · top 3%
Description
A square on the Cartesian plane has side length side with corners at (0,0), (0,side), (side,0), and (side,side). An array points lists coordinates on the boundary of this square.
Choose exactly k of these points so that the smallest pairwise Manhattan distance among them is as large as possible.
Return that maximum possible minimum Manhattan distance. The Manhattan distance between (xi, yi) and (xj, yj) is |xi - xj| + |yi - yj|.
Code
1
2
3