"Assume that the box contains 7 balls: 4 red, 2 green, and 1 yellow. Balls are drawn in succession without replacement, and their colors are noted until both a red and a green ball have been drawn."

How many outcomes are there in the sample space?"

the answer is 25, but i only know how to arrive at this answer by sketching a convoluted diagram or by racking my brain to figure out all the sets (RG, RRG, RRRG etc) and then counting the outcomes.

is there a faster way to figure out the number of outcomes using algebra or some other method? i don't think i'll have enough time on the test to draw a diagram.

thanks