Artificial intelligent assistant

Bag has 30 reds, yellows, and greens - How many combos of 10 have at most 3 yellow? I've solved this by calculating the sum of combinations with 0 yellows, 1 yellow, 2 yellows, and 3 yellows. $C(3+7-1,7) + C(3+8-1,8) + C(3+9-1,9) + C(3+10-1,10) = 36 + 45 + 55 + 66$ $= 202$ Is this the correct approach? I feel like I might need to multiply each combination by the combination of the remaining possibilities, but I'm not positive.

You can apply stars and bars assuming no constraints at first, and subtract those combos that have more than $3$ yellow (by pre-selecting $4$ yellow, and selecting the balance $6$ from any color)

thus $\binom{10+3-1}{3-1} - \binom{6+3-1}{3-1}$

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy f847a1cf649b458f5b17cf06d3bd232d