Example 2 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 $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 Competition Question)
The minimum value of $n$ is 8.
First, prove that each number in $S$ appears at least 2 times in the sequence $a_{1}, a_{2}, \cdots, a_{n}$.
In fact, if a number in $S$ appears only once in this sequence, since there are 3 subsets containing this number, but in the sequence, the adjacent pairs containing this number can have at most two different selections, it is impossible for all 3 subsets containing this number to appear as adjacent pairs in the sequence. This is a contradiction.
Therefore, we have $n \geqslant 8$.
Additionally, the sequence $3,1,2,3,4,1,2,4$ satisfies the problem's conditions and has only 8 terms, so the minimum value of $n$ is 8.