Python3 counting & functional programming
Approach
For each word, count arrangements of all letters.
Also count arrangements of each repeated letter.
Divide (1) by the product of (2) to drop all non-uni
Approach
--------
1. For each word, count arrangements of all letters.
2. Also count arrangements of each repeated letter.
3. Divide (1) by the product of (2) to drop all non-unique options.
4. Return the product of unique arrangements across words.

# Code
```python3 []
from operator import mul
from math import factorial
from collections import Counter

class Solution:
    def countAnagrams(self, s: str) -> int:
        MOD = 10 ** 9 + 7

        def count_unique_perms(word: str) -> int:
            counts = Counter(word).values()

            n_perms = factorial(len(word))
            n_duplicates = reduce(mul, map(factorial, counts))

            return (n_perms // n_duplicates) % MOD

        n_unique_perms = map(count_unique_perms, s.split(' '))
        return reduce(mul, n_unique_perms, 1) % MOD

```
['Python3']