Example 11 Let $S=\{1,2,3,4,5,6,7,8,9,10\}, A_{1}, A_{2}, \cdots, A_{k}$ be subsets of $S$, satisfying
(1) $\left|A_{i}\right|=5(1 \leqslant i \leqslant k)$;
(2) $\left|A_{i} \cap A_{j}\right| \leqslant 2(1 \leqslant i<j \leqslant k)$.

Find the maximum value of the number of such subsets $k$.
(1994 National Training Team 6th Test Question)
Solution 1: Construct a $10 \times k$ table, where the element in the $i$-th row and $j$-th column is
$$
a_{i j}=\left\{\begin{array}{l}
1\left(\text { if } i \in A_{j}\right) \\
0\left(\text { if } i \notin A_{j}\right)
\end{array}(i=1,2, \cdots 10, j=1,2, \cdots, k)\right. \text {. }
$$

Thus, the sum of the elements in the $i$-th row $l_{i}=\sum_{j=1}^{k} a_{i j}$ represents the number of sets among $A_{1}, A_{2}, \cdots, A_{k}$ that contain $i$, and the sum of the elements in the $j$-th column $\sum_{i=1}^{10} a_{i j}=\left|A_{j}\right|$ represents the number of elements in the set $A_{j}$. By the given condition (1), we have $\sum_{i=1}^{10} a_{i j}=\left|A_{j}\right|=5$, so
$$
\sum_{i=1}^{10} l_{i}=\sum_{i=1}^{10} \sum_{j=1}^{k} a_{i j}=\sum_{j=1}^{k} \sum_{i=1}^{10} a_{i j}=\sum_{j=1}^{k}\left|A_{j}\right|=5 k .
$$

If $r \in A_{i} \cap A_{j}$, then the triplet $\left\{A_{i}, A_{j}, r\right\}$ is formed, and the number of such triplets is denoted as $S$. On one hand, since $r$ belongs to $l_{r}$ sets among $A_{1}, A_{2}, \cdots A_{k}$, it can form $C_{l_{r}}^{2}$ triplets containing $r$, so $S=\sum_{r=1}^{10} C_{l_{r}}^{2}$. On the other hand, for any $A_{i}, A_{j}(1 \leqslant i<j \leqslant k)$, there are $\left|A_{i} \cap A_{j}\right|$ elements in $A_{i} \cap A_{j}$, which can form $\left|A_{i} \cap A_{j}\right|$ triplets containing $A_{i}, A_{j}$, so $S=\sum_{1 \leqslant i<j \leqslant k}\left|A_{i} \cap A_{j}\right|$, thus
$$
\sum_{1 \leqslant i<j \in k}\left|A_{i} \cap A_{j}\right|=\sum_{r=1}^{10} C_{l_{r}}^{2}=\frac{1}{2}\left(\sum_{r=1}^{10} l_{r}^{2}-\sum_{r=1}^{10} l_{r}\right) \text {. }
$$

Using (1) and the given condition (2) along with the Cauchy-Schwarz inequality, we get
$$
\begin{aligned}
k(k-1) & =2 C_{k}^{2} \geqslant \sum_{1 \leqslant i<j \leqslant k}\left|A_{i} \cap A_{j}\right| \geqslant \frac{1}{2}\left[\frac{1}{10}\left(\sum_{i=1}^{10} l_{i}\right)^{2}-\sum_{i=1}^{10} l_{i}\right] \\
& =\frac{1}{20}\left[(5 k)^{2}-10(5 k)\right]=\frac{5}{4} k(k-2),
\end{aligned}
$$

so $k \leqslant 6$.
Furthermore, the following 6 sets satisfy the problem's conditions:
$$
\begin{array}{l}
A_{1}=\{1,2,3,4,5\}, A_{2}=\{1,2,6,7,8\}, A_{3}=\{1,3,6,9,10\}, \\
A_{4}=\{2,4,7,9,10\}, A_{5}=\{3,5,7,8,10\}, A_{6}=\{4,5,6,8,9\} .
\end{array}
$$

In conclusion, the maximum value of $k$ is 6.