Example 7 Let $S=\{1,2,3,4\}$. An $n$-term sequence: $q_{1}, q_{2}, \cdots, q_{n}$ has the following property: For any non-empty subset $B$ of $S$ (the number of elements in $B$ is denoted by $|B|$), there are adjacent $|B|$ terms in the sequence that exactly form the set $B$. Find the minimum value of $n$.
(1997, Shanghai High School Mathematics Competition)
Solution: First, each number in $S$ appears at least twice in the sequence $q_{1}, q_{2}$, $\cdots, q_{n}$, otherwise, since there are 3 binary subsets containing a certain number, but in the sequence, the number of adjacent pairs containing this number is at most 2, therefore, $n \geqslant 8$.

Moreover, the 8-term sequence: $3,1,2,3,4,1,2,4$ satisfies the condition exactly, hence the minimum value of $n$ is 8.