You might start with the idea that each letter is a different color; so you have 9 unique letter-color items to select for a permutation: For example, you swap an orange M with the green M and you have a different order of the elements.
So there are 9! ways to chose those 9 letters.
Now, if all of the letters are the same color–equivalently, we’re going to ignore color now–changing the position of the two M’s is no longer a different combination. So how many “duplicates” would there be? Well, consider the case when the letters were different colors and you’ll see (after some thought) that you’ll have 2! x 2! x 2! possible ways of selecting the order of the “duplicates” for any given configuration where those letters would appear in a sequence. So we just divide these out from the total.