Let $W(c,n)$ denote the number of words of length $c$ from an alphabet of $n$ letters. Then $W(c,n)=n^c$.
Out of these, the number of words of the same size that do not contain one of the letters is $W(c,n-1)=(n-1)^c$. The number of ways of choosing which letter is missing is $\binom{n}{1}$.
The number of words of the same size that do not contain two letters is $W(c,n-2)=(n-2)^c$. The number of ways of choosing which two letters are missing is $\binom{n}{2}$... and so on ...
Now we use inclusion-exclusion principle: (subtract the number of words missing one of the letters, then add the number missing two of the letters, subtract the number missing three of the letters,...)
We get:
$$W(c,n)-\binom{n}{1}W(c,n-1)+\binom{n}{2}W(c,n-2)-\binom{n}{3}W(c,n-3)+\cdots+(-1)^{n-1}\binom{n}{n-1}W(c,n-(n-1)).$$
This is
$$n^c-\binom{n}{1}(n-1)^c+\binom{n}{2}(n-2)^c-\binom{n}{3}(n-3)^c+\cdots+(-1)^{n-1}\binom{n}{n-1}1^c.$$
or
$$\sum_{k=0}^{n-1}(-1)^k\binom{n}{k}(n-k)^c.$$
Another way could be: Denote $S_c^n$ the number of ways to partition the word of length $c$ into $n$ pieces. Then we just need to choose which letter goes to each of the $n$ pieces. This number is $n!$. So the number of words we are looking for is
$$n!S_c^n.$$
The numbers $S_c^n$ are called Stirling's numbers of the second kind.
If we have exactly one repetition is allowed, we start by choosing our three letters: $\binom{26}{3}$. We then choose a letter to be repeated in $\binom{3}{1} = 3$ ways. Finally, we permute our letters in $4!/2!$ ways by the multinomial distribution. By rule of product, we multiply, to get:
$$\binom{26}{3} \cdot 3 \cdot 4!/2!$$
Or add the four letter words with no repetitions (26*25*24*23) plus the ones with one repetition.
This is correct thinking. Notice that the words with no repetition are disjoint from words with exactly one repetition. So by rule of sum, you add $26!/(26-4)!$ with the quantity I noted above.
Best Answer
First choose $3$ places for $A$ and $4$ places for B.
Number of ways to do that is $\displaystyle {10 \choose 3} {7 \choose 4}$
Now in remaining $3$ places, put any of the $24$ letters in $24^3$ ways (considering repetitions are allowed).
So total number of words that can be made is $ \ \displaystyle \frac{10!}{3! \ 3! \ 4!} \cdot 24^3$