Not entirely sure if this is correct but here it goes:
So I started by just dealing with the words that would have double T's or O's
If the word has two T's, then the possible combinations are:
TT-, T-T, -TT, where the dash can be O/M/A
Therefore number of words with two T's in it is 3(since there are 3 different TT positions) x 3 (O/M/A) = 9
Do the same thing for the words with two O's
OO-, O-O, -OO, where dashes can be T/M/A
Therefore 3x3 = 9 once again
Now that we've dealt with the double letter words, we're just left with the single letter words, and we have T,M,O and A to choose from
So for this its just solving the question as if they only gave us these 4 letters and asked us to make 3 letter words
Therefore 4x3x2 = 24
So total number of words = 24+9+9=42
There's probably a quicker more elegant way to do this but I don't know it
