$\square$ Example 18 Let $2 n$ real numbers $a_{1}, a_{2}, \cdots, a_{2 n}$ satisfy the condition $\sum_{i=1}^{2 n-1}\left(a_{i+1}-a_{i}\right)^{2}=$ 1, find the maximum value of $\left(a_{n+1}+a_{n+2}+\cdots+a_{2 n}\right)-\left(a_{1}+a_{2}+\cdots+a_{n}\right)$. (2003 China Western Mathematical Olympiad Problem)
First, when $n=1$, $\left(a_{2}-a_{1}\right)^{2}=1$, so $a_{2}-a_{1}= \pm 1$. It is easy to see that the maximum value required at this time is 1.

When $n \geqslant 2$, let $x_{1}=a_{1}, x_{i+1}=a_{i+1}-a_{i}, i=1,2, \cdots, 2 n-1$, then $\sum_{i=2}^{2 \pi} x_{i}^{2}=1$, and $a_{k}=x_{1}+x_{2}+\cdots+x_{k}, k=1,2, \cdots, 2 n$. Therefore, by the Cauchy-Schwarz inequality, we have
$$\begin{array}{l}
\left(a_{n+1}+a_{n+2}+\cdots+a_{2 n}\right)-\left(a_{1}+a_{2}+\cdots+a_{n}\right) \\
=n\left(x_{1}+x_{2}+\cdots+x_{n}\right)+n x_{n+1}+(n-1) x_{n+2}+\cdots+x_{2 n}-\left[n x_{1}\right. \\
\left.+(n-2) x_{2}+\cdots+x_{n}\right] \\
=x_{2}+2 x_{2}+\cdots+(n-1) x_{n}+n x_{n+1}+(n-1) x_{n+2}+\cdots+x_{2 n} \\
\leqslant\left[1^{2}+2^{2}+\cdots+(n-1)^{2}+n^{2}+(n-1)^{2}+\cdots+2^{2}+1^{2}\right]^{\frac{1}{2}} \cdot \\
\left(x_{2}^{2}+x_{3}^{2}+\cdots+x_{n}^{2}\right)^{\frac{1}{2}} \\
=\left[n^{2}+2 \times \frac{1}{6}(n-1) n(2 n-1)\right]^{\frac{1}{2}}=\sqrt{\frac{n\left(2 n^{2}+1\right)}{3}} . \\
\text { When } a_{k}=\frac{\sqrt{3} k(k-1)}{2 \sqrt{n\left(2 n^{2}+1\right)}}, k=1,2, \cdots, n, a_{n+k}= \\
\frac{\sqrt{3}\left[2 n^{2}-(n-k)(n-k+1)\right]}{2 \sqrt{n\left(2 n^{2}+1\right)}}, k=1,2, \cdots, n \text {, the equality in the above inequality }
\end{array}$$

holds.
Therefore, the maximum value of $\left(a_{n+1}+a_{n+2}+\cdots+a_{2 n}\right)-\left(a_{1}+a_{2}+\cdots+a_{n}\right)$ is $\sqrt{\frac{n\left(2 n^{2}+1\right)}{3}}$.