Leetcode Solutions Java Python C++
All contents and pictures on this website come from the Internet and are updated regularly every week. They are for personal study and research only, and should not be used for commercial purposes. Thank you for your cooperation.
Welcome to Subscribe On Youtube:

612. Shortest Distance in a Plane

Table point_2d holds the coordinates (x,y) of some unique points (more than two) in a plane.

 

Write a query to find the shortest distance between these points rounded to 2 decimals.

 

| x  | y  |
|----|----|
| -1 | -1 |
| 0  | 0  |
| -1 | -2 |

 

The shortest distance is 1.00 from point (-1,-1) to (-1,2). So the output should be:

 

| shortest |
|----------|
| 1.00     |

 

Note: The longest distance among all the points are less than 10000.

 

Difficulty:

Medium

Lock:

Prime

Company:

Microsoft

Problem Solution

612-Shortest-Distance-in-a-Plane

All Problems:

Link to All Problems
All contents and pictures on this website come from the Internet and are updated regularly every week. They are for personal study and research only, and should not be used for commercial purposes. Thank you for your cooperation.