C++ || FACTORIAL
calculate no of possible combinarion of each word and than multiplay each calculated ans of each word.\n# Code\n\nclass Solution {\npublic:\n    int modin(int x
calculate no of possible combinarion of each word and than multiplay each calculated ans of each word.\n# Code\n```\nclass Solution {\npublic:\n    int modin(int x){\n        int k = 1e9+5, mod = 1e9+7,ans = 1;\n        while(k){\n            if(k&1){\n                ans = (ans*1LL*x)%mod;\n            }\n            x = (x*1LL*x)%mod;\n            k >>= 1;\n        }\n        return ans;\n    }\n    int countAnagrams(string s) {\n        int ans = 1, mod = 1e9+7,k;\n        int n = s.length(),i;\n        vector<int> dp(n+1,1);\n        for(i = 2; i <= n; i++){\n            dp[i] = (i*1LL*dp[i-1])%mod;\n        }\n        vector<int> v(26,0);\n        int x = 0;\n        for(auto &i: s){\n            if(i==\' \'){\n                k = dp[x];\n                for(auto &j: v){\n                    if(j>1)\n                        k = (k*1LL*modin(dp[j]))%mod;\n                }\n                ans = (ans*1LL*k)%mod;\n                // cout<<ans<< " ";\n                fill(v.begin(),v.end(),0);\n                x = 0;\n            }else{\n                x++;\n                v[i-\'a\']++;\n            }\n        }\n        // cout<<"#";\n                k = dp[x];\n                for(auto &j: v){\n                    if(j>1)\n                        k = (k*1LL*modin(dp[j]))%mod;\n                }\n                ans = (ans*1LL*k)%mod;\n        // cout<<ans;\n        \n        return ans;\n    }\n};\n```
['Hash Table', 'Math', 'String', 'Combinatorics', 'C++']