Question: You are given a list coords representing the integer positions of various points on a 2 D grid, where coords [ i ] = [
You are given a list coords representing the integer positions of various points on a D grid, where coordsix
yidefines the coordinates of the ith point.
The distance between any two points is now calculated using a Minimum Distance Formula. You need to determine the smallest possible value of the largest distance between any two points after removing exactly one point from the list.
Minimum Distance Formula:
The distance between two points xyxy and xyxy is calculated as
maxix xlyymaxxxly y This formula gives the largest difference between the x or y coordinates of two points.
Return the minimum possible value for maximum distance between any two points by removing exactly one point.
Example :
Input: coords
Output:
Explanation:
The maximum distance after removing each coord is the following:
After removing the Oth point the maximum distance is between coords and which is
After removing the st point the maximum distance is between coords and which is
After removing the nd point the maximum distance is between coords and which is
After removing the rd point the maximum distance is between coords and which is
is the minimum possible maximum distance between any two coords after removing exactly one coord.
Example :
Input: coords
Output:
Explanation:
Removing any of the coords results in the maximum distance between any two coords of
Constraints:
coords.length
coordslj length
coordsil coordsi
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
