Example 6 Let $M=\{1,2, \cdots, 20\}, A_{1}, A_{2}, \cdots A_{n}$ be distinct non-empty subsets of $M$, such that when $i \neq j$, $A_{i} \cap A_{j}$ has at most two elements. Find the maximum value of $n$.

 untranslated text remains the same as the source text in terms of line breaks and formatting.