We will consider the following cases :
Case I - when 4 alike and 2 others alike flags are used (4 white and 2 red ),
then no. of signals =6!4!2!=15
Case II -when 4 alike and 2 others different flags are used (4 white, l red and 1 blue ) then no. of signals =6!4!=30
Case III - when 3 alike and 3 others alike flags are used (3 white, 3 red ) then no. of signals =6!3!3!=20
Case IV - when 3 alike and 2 other alike and 1 different flags are used (3 white, 1 blue. 2 red or 3 red, 1 blue, 2 white)
then no. of signals =2×6!3!2!=120
Total =15+30+20+120=185