[C++|Java|Python3] multinomial coefficients
Please pull this commit for solutions of biweekly 94. \n\nIntuition\nOn the math level, this is basically a test of multinomial coeffcients. The tricky part lie
Please pull this [commit](https://github.com/gaosanyong/leetcode/commit/3ffc910c12ff8c84890fb15351216a0fa85dc3ac) for solutions of biweekly 94. \n\n**Intuition**\nOn the math level, this is basically a test of multinomial coeffcients. The tricky part lies in the implementation. \n**C++**\n```\nclass Solution {\npublic: \n    int countAnagrams(string s) {\n        const int mod = 1\'000\'000\'007; \n        int n = s.size(); \n        vector<long> fact(n+1, 1), ifact(n+1, 1), inv(n+1, 1); \n        for (int x = 1; x <= n; ++x) {\n            if (x >= 2) inv[x] = mod - mod/x * inv[mod%x] % mod; \n            fact[x] = fact[x-1] * x % mod; \n            ifact[x] = ifact[x-1] * inv[x] % mod; \n        }\n        long ans = 1; \n        istringstream iss(s); \n        string buff; \n        while (iss >> buff) {\n            ans = ans * fact[buff.size()] % mod; \n            vector<int> freq(26); \n            for (auto& ch : buff) ++freq[ch-\'a\']; \n            for (auto& x : freq) ans = ans * ifact[x] % mod; \n        }\n        return ans; \n    }\n}; \n```\n**Java**\n```\nclass Solution {\n\tpublic int countAnagrams(String s) {\n\t\tfinal int mod = 1_000_000_007; \n\t\tint n = s.length(); \n\t\tlong[] fact = new long[n+1], ifact = new long[n+1], inv = new long[n+1]; \n\t\tfact[0] = ifact[0] = inv[0] = inv[1] = 1; \n\t\tfor (int x = 1; x <= n; ++x) {\n\t\t\tif (x >= 2) inv[x] = mod - mod/x * inv[mod%x] % mod; \n\t\t\tfact[x] = fact[x-1] * x % mod; \n\t\t\tifact[x] = ifact[x-1] * inv[x] % mod; \n\t\t}\n\t\tlong ans = 1; \n\t\tfor (var buff : s.split(" ")) {\n\t\t\tans = ans * fact[buff.length()] % mod; \n\t\t\tint[] freq = new int[26]; \n\t\t\tfor (var ch : buff.toCharArray())  ++freq[ch-\'a\']; \n\t\t\tfor (var x : freq) ans = ans * ifact[x] % mod; \n\t\t}\n\t\treturn (int) ans; \n\t}\n}\n```\n**Python3**\n```\nclass Solution: \n    def countAnagrams(self, s: str) -> int:\n        n = len(s)\n        mod = 1_000_000_007\n        inv = [1]*(n+1)\n        fact = [1]*(n+1)\n        ifact = [1]*(n+1)\n        for x in range(1, n+1): \n            if x >= 2: inv[x] = mod - mod//x * inv[mod % x] % mod \n            fact[x] = fact[x-1] * x % mod \n            ifact[x] = ifact[x-1] * inv[x] % mod \n        ans = 1\n        for word in s.split(): \n            ans *= fact[len(word)]\n            for x in Counter(word).values(): ans *= ifact[x]\n            ans %= mod \n        return ans \n```
['C', 'Java', 'Python3']