Problem - 4330
How many $4$-digit integers are there whose sum of all digits equals $12$?
This is equivalent to find the coefficient of the $x^{12}$ term in the following polynomial: $$f(x)=(x+x^2+\cdots+x^9)(1+x+x^2+\cdots+x^9)^3$$
because the thousands digit can not be $0$ and all the remaining $3$ digits can be any of $0$ to $9$. $$\begin{align*} f(x)=\ & (x+x^2+\cdots+x^9)(1+x+x^2+\cdots+x^9)^3 \\ =\ &\frac{x-x^{10}}{1-x}\left(\frac{1-x^{10}}{1-x}\right)^3 \\ =\ &\frac{(x-x^{10})(1-x^{10})^3}{(1-x)^4} \\ =\ & x(x^{39}-x^{30}-3x^{29}+3x^{20}+3x^{19}-3x^{10}-x^9+1)\sum_{k=0}^{\infty}\binom{3+k}{3}x^k\end{align*}$$
Therefore, the coefficient of the term $x^{12}$ equals $$-3\cdot\binom{3+1}{3}-\binom{3+2}{3}+\binom{3+11}{3}=\boxed{342}$$