Example 5 Try to find the largest and smallest seven-digit numbers, without repeated digits, that can be formed from the 7 digits $0,1,2 ; 3,4,5,6$ and are divisible by 165 (require a brief reasoning process).
(199d, Huanggang Region, Hubei Province Junior High School Mathematics Competition)
Solution: From $165=3 \times 5 \times 11$, we know that the required number must be divisible by $3, 5, 11$.
Since $0+1+2+3+4+5+6=21$,
the seven-digit number must be divisible by 3.
According to the characteristics of numbers divisible by 11, let the sum of the four digits in the odd positions of the required seven-digit number be $A$, and the sum of the three digits in the even positions be $B$, then we have
$|A-B|=11 k \quad$ ( $k$ is a non-negative integer).
Also, $A+B=21$, and $A, B$ are natural numbers,
$\therefore|A-B|<21$.
Since $A+B$ is odd, then $A-B \neq 0$, i.e., $k \neq 0$, so only $k=1$.
$\therefore A$ and $B$ are 16 and 5, respectively.
Also, $0+1+2+3=6$, so $A$ cannot be 5. Thus, $A=16, B=5$.

Among the seven digits, the sum of three numbers being 5 can only be 0, 1, 4 or 0, 2, 3, so
(1) $B=0+1+4 \quad A=2+3+5+6$,
(2) $B=0+2+3 \quad A=1+4+5+6$.
Clearly, 0 in the even position cannot be the last digit, and since the required number is divisible by 5, the last digit must be 5.
It is easy to see that the largest number is 6431205, and the smallest number is
1042635.