### Your python code here! (Slow but functional.)

Reason:
• $${9 \choose 2}\cdot 7$$ ways to choose digits for the pattern AABBC (first pick the digits to be A and B, then pick the digit to be C), then $$\frac{5!}{2!2!}$$ distinct permutations from that pattern.
• $${9 \choose 2}\cdot 7$$ ways to choose digits for the pattern AAABC (first pick the digits to be B and C, then pick the digit to be A), then $$\frac{5!}{3!}$$ distinct permutations from that pattern.
Now $${9 \choose 2} \cdot 7= \frac{9\cdot 8 \cdot 7}{2} = 252$$ and $$\frac{5!}{2!2!}=5\cdot 3\cdot 2=30$$ and $$\frac{5!}{3!}=5\cdot 4=20$$. So the total number is $$252\cdot 30+252\cdot 20=252\cdot 50 = 12600$$.