Asif wants to build tower of cubes Statement:

Asif has cubes of three colors. He builds a tower from them, placing
each next cube on the previous one. It is forbidden to use more than
$4$ cubes of each color. Asif finishes building the tower as soon as
it contains $4$ cubes of some two colors. How many different towers
can Asif build?

My thoughts:
For me, let's think the color are red(r), green(g), blue(b) and so I need to find the permutations of $rrrrggggbbbb$ which is $ \frac{12!}{(4!)^3}$ but later I understood it can be with 1 cube, 2 cubes, 3 cubes ....12 cubes tower. I can't find out how to encounter it.
Thank you so much for your help in advance.
 A: Please note that you can make a tower of minimum $8$ cubes and maximum $11$ cubes. Lower bound is obvious. Now take the upper bound. This is because the moment you have $4$ cubes of two colors, you stop. So as an example, if I have an arrangement of $(4R, 3B, 3G, B)$, I stop.
So I first choose which two colors, I will have $4$ cubes of. I can have $0, 1, 2, 3$ cubes of the last color.
So number of ways to choose colors $ = 3$
Interesting thing to note is that if I take $11$ cubes with $4$ each of two colors and $3$ of one, it should give me all permissible cubes. Say we have $4 R$, $4 B$, $3 G$. Now if one $G$ is on top and rest two are below one of the $R, B$, those are valid arrangements of $10$ cubes. If all $3$ greens are on top, those are valid arrangements of $8$ cubes.
So the answer is $ = 3 \times \frac{11!}{4!4!3!} = 34650$
If this is not convincing, here is another approach you can take -
Fix $2$ colors $R \ B$ with $4$ cubes each.
Number of towers with $8$ cubes $ = \frac{8!}{4!4!} = 70$
Now for towers with $9$ cubes, the green cube can be in any of the $8$ positions out of $9$ (except the last)
So number of towers with $9$ cubes $ = 8 \times \frac{8!}{4!4!} = 560$
Now for towers with $10$ cubes, the last cube has to be either blue or red.
So number of towers with $10$ cubes $ = 2 \times \frac{9!}{4!3!2!} = 2520$
Similarly, number of towers with $11$ cubes $ = 2 \times \frac{10!}{4!3!3!} = 8400$
Adding all of them, we get $11550$. Now multiply this by $3$ as the color with less than $4$ cubes can be any of the three. That is your answer. Same as earlier.
