$7 \cdot 117$ Let $S=\{1,2,3,4\} ; n$ terms of the sequence $a_{1}, a_{2}, \cdots a_{n}$ have the following property: for any non-empty subset $B$ of $S$ (the number of elements in set $B$ is denoted as $|B|$ ), there are adjacent $|B|$ terms in the sequence that exactly form the set $B$. Find the minimum value of the number of terms $n$.
[Solution] For each $i \in S$, it can form a binary subset with each of the other 3 elements in $S$, meaning there are 3 binary subsets containing $i$. If $i$ appears only once in the sequence, then the number of adjacent pairs containing $i$ is at most two. Therefore, $i$ must appear at least twice in the sequence. Since 1, 2, 3, and 4 all appear at least twice, the sequence must have at least 8 terms, i.e., $n \geqslant 8$.
On the other hand, it is easy to verify that the 8-term sequence $3,1,2,3,4,1,2,4$ satisfies the conditions of the problem. Therefore, the minimum value of the number of terms $n$ in the sequence is 8.