Example 2 There are 1989 points in space, with no 3 points collinear, and they are divided into 30 groups with different numbers of points. From any 3 different groups, take one point from each, and form a triangle with these 3 points. Question: To maximize the total number of such triangles, how many points should each group have? (4th China Mathematical Olympiad)
Analysis Intuition tells us that when the number of points in each group is equal, the total number of triangles is maximized. However, upon careful reading of the problem, we find that the requirement is for the number of points in each group to be distinct, leading us to think that the number of points in each group should be as close as possible. To reinforce this feeling, we can use special cases to verify.

First, consider the case of 10 points divided into 3 groups. When the number of points in each group is 1, 2, and 7, the total number of triangles $S=14$, which can be briefly written as $S(1,2,7)=14$. Similarly, $S(1,3,6)=18$, $S(1,4,5)=20$, and $S(2,3,5)=30$. Among these, $S(2,3,5)=30$ is the largest. For the general case, from the above special cases, we can boldly conjecture: when the number of points $n_{i}$ in each group is as close as possible, $S$ is maximized. By "as close as possible," we mean that the difference between any two adjacent $n_{t}$ and $n_{t+1}$ should be as small as possible. Clearly, $n_{t}$ and $n_{t+1}$ must differ by at least 1, but can we ensure that for all $n_{t}$ and $n_{t+1}$, $n_{t+1}-n_{t}=1$? Studying this can lead us to the solution.

Solution Let the number of points in each group be: $n_{1}, n_{t}, n_{t+1}$. Therefore, $S^{\prime}>S$, which is a contradiction. So, $n_{t+1}-n_{t}=1$ or 2.
(2) There is at least one $t(1 \leqslant t \leqslant 29)$ such that $n_{t+1}-n_{t}=2$.

In fact, if for all $t$, $n_{t+1}-n_{t} \neq 2$, and by (1), $n_{t+1}-n_{t} \leqslant 2$, so $n_{t+1}-n_{t}=1$, meaning $n_{1}, n_{2}, \cdots, n_{30}$ are 30 consecutive positive integers, and their sum is a multiple of 15. However, $\sum_{t=1}^{30} n_{t}=1989$ is not a multiple of 15, which is a contradiction.
(3) There is at most one $t(1 \leqslant t \leqslant 29)$ such that $n_{t+1}-n_{t}=2$.

In fact, if there are $s, t(1 \leqslant s < t \leqslant 29)$ such that $n_{s+1}-n_{s}=2$ and $n_{t+1}-n_{t}=2$, then $n_{s+1}=n_{s}+2$ and $n_{t+1}=n_{t}+2$. Since $n_{s+1} > n_{s}$ and $n_{t+1} > n_{t}$, we have $n_{s+1} > n_{s}$ and $n_{t+1} > n_{t}$. Therefore, $S^{\prime}>S$, which is a contradiction.

From (2) and (3), we know that there is exactly one $t(1 \leqslant t \leqslant 29)$ such that $n_{t+1}-n_{t}=2$.
Finally, we prove that the array $n_{1}, \cdots, n_{30}$ that simultaneously satisfies (1), (2), and (3) is unique.
In fact, without loss of generality, let the 30 numbers be: $n_{1}, n_{1}+1, n_{1}+2, \cdots, n_{1}+t-1, n_{1}+t+1, n_{1}+t+2, \cdots, n_{1}+30$. Then, $n_{1}+(n_{1}+1)+(n_{1}+2)+\cdots+(n_{1}+t-1)+(n_{1}+t+1)+(n_{1}+t+2)+\cdots+(n_{1}+30)=1989$.

So, $(n_{1}+t)+(n_{1}+1)+(n_{1}+2)+\cdots+(n_{1}+t-1)+(n_{1}+t+1)+(n_{1}+t+2)+\cdots+(n_{1}+30)=1989+t$, which means $1989+t=30n_{1}+(1+2+\cdots+30)=30n_{1}+15 \times 31$.

So, $1974+t=30n_{1}+15 \times 30$, $30|1974+t$, $30|24+t$, but $1 \leqslant t \leqslant 29$, so $t=6$.

In summary, the number of points in each group is $51, 52, \cdots, 56, 58, 59, \cdots, 81$.