The general approach to problems like this is via exponential generating functions. That is, we solve the more general problem of how many strings of length $n$ can be formed from BALL: say this number is $a_n$. Then we define the exponential generating function of $a_n$ as
$$f(x) = \sum_{n=0}^{\infty} \frac{a_n}{n!} x^n$$
Since we have one A, one B, and two Ls, the generating function in this case is
$$f(x) = (1+x) (1+x) \left(1 + x + \frac{1}{2!} x^2 \right)$$
When we expand $f(x)$ as a polynomial, we find
$$f(x) = 1 + 3x + \frac{7}{2!} x^2 + \frac{12}{3!} x^3 + \frac{12}{4!}x^4$$
so there are $3$ strings of length one, $7$ strings of length two, $12$ strings of length three, and $12$ strings of length four that can be formed from BALL.
If you are not familiar with generating functions, you can read about them in many books on combinatorics. One free on-line resource is Enumerative Combinatorics Through Guided Discovery (pdf) by Kenneth P. Bogart. Another is a book devoted entirely to generating functions, generatingfunctionology (pdf)
by Herbert Wilf.
AAandBBin our count which would have been included in the earlier calculation. The full process for arbitrary scenarios is often quite involved and very tedious. – JMoravitz Jun 19 '18 at 17:24