The first step is to determine the total number of all possible positions. Given that there are 4 distinct cards, the total number is 4! = 4 * 3 * 2 * 1 = 24.
Now we will determine how many combinations have the red cards NOT next to each other. At first, we will assume the red and black cards are the same, and then double the number of combinations to account for the fact that the red cards are different, and then double that value again to account for the fact that the black cards are different.
Possible combinations if the cards are identical:
RBRB, RBBR, BRBR
There are 3 possible combinations if the red and black cards are identical. If the red cards are different, we can double the number of combinations, so there are 6 total combinations. Since both the red and black cards are different, we will double it again and find that there are 12 possible configurations (I will enumerate them here, but on the test it is faster to not to do this!).
Possible combinations(R=red, B=black):
R1B1R2B2, R2B1R1B2, R2B2R1B1, R1B2R2B1, R1B1B2R2, R2B1B2R2, R1B2B1R2, R2B2B1R2, B1R1B2R2, B1R2B2R1, B2R1B1R2, and B2R2B1R1.
So there are 12 possible combinations, and the answer is [D].