How can I calculate the total number of possible anagrams for a set of letters?
For example:
"Math" : 24 possible combinations.
math
maht
mtah
mtha
mhat
mhta
amth
amht
atmh
athm
ahmt
ahtm
tmah
tmha
tamh
tahm
thma
tham
hmat
hmta
hamt
hatm
htma
htam
Total: 24
I generated this by actually generating each combination, one by one, but I want to know the formula for calculating the total possible number of combinations of any group of letters.