Simple python3 Solution || Explained code
Intuition\nCode explained in comments.\n\n# Code\n\n#from itertools import permutations\nclass Solution:\n    def countAnagrams(self, s: str) -> int:\n        m
# Intuition\nCode explained in comments.\n\n# Code\n```\n#from itertools import permutations\nclass Solution:\n    def countAnagrams(self, s: str) -> int:\n        mod= 10**9 + 7\n        #splitting the words of string s in list w\n        w=s.split(" ")\n        a=[]\n        #then iterating the words in list and appending the permutation of the word to list a\n        for i in w:\n            a.append(Solution.perm(i))\n        #multiplying the elements of list to return the total count of Anagrams\n        result = 1\n        for num in a:\n            result *= num\n        return result % mod\n\n    #function to calculate the permutation of a given string \n    def perm(inputt):\n        char_counts = Counter(inputt)\n        total_permutations = factorial(len(inputt))\n        denominator = 1\n        for i in char_counts.values():\n            denominator *= factorial(i)\n        return total_permutations // denominator\n```
['Python3']