Question 21. One red flag, three white flags and two blue flags are arranged in a line such that,
(A) no two adjacent flags are of the same colour
(B) the flags at the two ends of the line are of different colours.
In how many different ways can the flags be arranged?