Stop four cars first, and then put three empty parking spaces in the middle of the car, and these three empty parking spaces are divided into two groups, one is two, and the other is 1.
There are two situations,
One: the red and white cars are not adjacent, so you can insert them at will:
Two cars are arranged next to each other: a (3,3 3) * a (2 2,2) =12.
So the two cars are not adjacent: A (4 4,4)-12 =12.
Four cars, five empty, two groups of empty parking spaces: c (5,2) a (2)A(2) *12 = 240.
Two: the red and white cars are adjacent, and at least one space should be inserted between the two cars:
Two cars are arranged next to each other: 12
There are three spaces between the red and white cars: 12.
There is one or two empty seats between the red and white cars. First, put a group of vacancies between the two cars, and the other group can choose one of the other four vacancies: c (21) c (41) *12 = 96.
So the second case is: 12+96= 108.
There are two cases: 240+ 108=348.