Points and Minimum Distance

From Codeforces 1895B, Points and Minimum Distance. The input is a flat sequence of 2n integers. Pair the values into n points and order the points into a path. Return a flat construction containing the minimum path length followed by the 2n coordinates in visit order. Any construction with the minimum length is valid.

Examples
Input: [1,2,3]
Output: 0
Hints

Points and Minimum Distance

**From Codeforces 1895B, Points and Minimum Distance.** The input is a flat sequence of `2n` integers. Pair the values into `n` points and order the points into a path. Return a flat construction containing the minimum path length followed by the `2n` coordinates in visit order. Any construction with the minimum length is valid.