$\square$ Example 1 Let real numbers $x_{1}, x_{2}, \cdots, x_{1997}$ satisfy the following two conditions:
(1) $-\frac{1}{\sqrt{3}} \leqslant x_{i} \leqslant \sqrt{3}(i=1,2, \cdots, 1997)$;
(2) $x_{1}+x_{2}+\cdots+x_{1997}=-318 \sqrt{3}$.

Find the maximum value of $x_{1}^{12}+x_{2}^{12}+\cdots+x_{1997}^{12}$. (1997 China Mathematical Olympiad Problem)
Solve for any set of $x_{1}, x_{2}, \cdots, x_{1997}$ that satisfies the given conditions. If there exist such $x_{i}$ and $x_{j}$ such that $\sqrt{3}>x_{i} \geqslant x_{j}>-\frac{1}{\sqrt{3}}$, then let $m=\frac{1}{2}\left(x_{i}+x_{j}\right), h_{0}=$ $\frac{1}{2}\left(x_{i}-x_{j}\right)=x_{i}-m=m-x_{j}$

We observe that $(m+h)^{12}+(m-h)^{12}=2 \sum_{0 \leq k \leq 12} \mathrm{C}_{12}^{k} m^{12-k} h^{k}$ increases as $h > 0$ increases. We agree to take $h=\min \left\{\sqrt{3}-m, m-\left(-\frac{1}{\sqrt{3}}\right)\right\}$, and replace $x_{i}$ and $x_{j}$ with $x_{i}^{\prime}=m+h, x_{j}^{\prime}=m-h$. Their sum remains unchanged, and their 12th power sum increases. Therefore, the maximum value of the 12th power sum can only be achieved in the following scenario: at most one variable takes a value in $\left(-\frac{1}{\sqrt{3}}, \sqrt{3}\right)$, and the rest of the variables are either $-\frac{1}{\sqrt{3}}$ or $\sqrt{3}$.

Suppose $u$ variables take the value $-\frac{1}{\sqrt{3}}, v$ variables take the value $\sqrt{3}, w(=0$ or 1$)$ variables take a value in $\left(-\frac{1}{\sqrt{3}}, \sqrt{3}\right)$ (if there is one, denote this value as $t$), then
$$\left\{\begin{array}{l}
u+v+w=1997 \\
-\frac{1}{\sqrt{3}} u+\sqrt{3} v+t w=-318 \sqrt{3},
\end{array}\right.$$

From this, we get $4 v+(\sqrt{3} t+1) w=1043$.
Since $(\sqrt{3} t+1) w=1043-4 v$ is an integer, and $0 \leqslant 1043-4 v<4$, $(\sqrt{3} t+1) w$ is the remainder when 1043 is divided by 4. According to this, we find
$$v=260, t=\frac{2}{\sqrt{3}}, u=1736$$

According to the above discussion, the maximum value of $x_{1}^{12}+x_{2}^{12}+\cdots+x_{1997}^{12}$ is
$$\begin{aligned}
& \left(-\frac{1}{\sqrt{3}}\right)^{12} u+(\sqrt{3})^{12} v+t^{12} \\
= & \frac{1736+4096}{729}+729 \times 260=8+189540=189548
\end{aligned}$$