Let the no. of ways in which both M's and O's are together be iii.Then,We can see that i and ii both include iii in them.I mean,In the cases when M's are together,there will be some cases in which both M's and O's are together.Similarly,when O's are together,there will be some cases in whuch both O's and M's are together.So,we are subtracting these cases two times and hence,need to add them once.So,the answer is
(Total)-(I+II)+III.
In this case,Total=6!/2!2! ,I=5!/2! ,II=5!/2! ,III=4!
Hence,the answer is (6!/4)-5!+4!=180-120+24=84 ways.
Hope you got it.Is my answer correct?
MAKING A MISTAKE IS HUMAN BUT REPEATING IT IS IDIOTIC.