Python one-line solution
This is just for fun.\nGo to https://leetcode.com/problems/count-anagrams/solutions/2947480/multiply-permutations for detailed math explanation.\n\n# Code\npyth
This is just for fun.\nGo to https://leetcode.com/problems/count-anagrams/solutions/2947480/multiply-permutations for detailed math explanation.\n\n# Code\n```python3 []\nclass Solution:\n    def countAnagrams(self, s: str) -> int:\n        return reduce(operator.mul, [factorial(len(w)) // (reduce(operator.mul, [factorial(n) for n in Counter(w).values()])) for w in s.split(" ")])%(10**9 + 7)\n```\n\n# Credits\nhttps://leetcode.com/problems/count-anagrams/solutions/2947480/multiply-permutations
['Python3']