Loading problem...
You are given a table named Point where each row stores one unique integer coordinate on a one-dimensional number line.
Schema:
Column meaning:
Task: Compute the smallest absolute distance between any two distinct points and return it as a single value.
Output requirements:
Supported submission environments:
Point:
| x |
|----|
| -1 |
| 0 |
| 2 |[
{"shortest":1}
]The closest pair is -1 and 0, so the minimum distance is 1.
Point:
| x |
|----|
| 10 |
| 3 |
| 20 |
| 14 |
| 13 |[
{"shortest":1}
]The closest pair is 13 and 14, giving distance 1.
Point:
| x |
|----|
| -8 |
| -3 |
| 5 |
| 12 |[
{"shortest":5}
]Sorted values are -8, -3, 5, 12. Adjacent gaps are 5, 8, and 7, so the minimum is 5.
Constraints