NewProject Coding is here — build features and fix bugs in real codebases with an AI assistantSee what's new

(This question is a variation of the LeetCode question 973. K Closest Points to Origin. If you haven't completed that question yet, it is recommended to solve it first.)

You are given an array of points where points[i] = [xix_i, yiy_i] represents a point on a 2D plane. Your task is to find the minimum Euclidean Distance between any two distinct points in the array.

The Euclidean distance between two points [x1x_1, y1y_1] and [x2x_2, y2y_2] is calculated as ((x1−x2)2+(y1−y2)2)\sqrt{((x₁ - x₂)² + (y₁ - y₂)²)}.

Test Cases
Input
Output
Expected