|| C++
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic: \n    const int mod = 1e9+7;\n \n    long long mod_pow(long long b,long long e){\n        long long result =1;\n        while(e>0){\n            if(e&1){\n                result = (result*b)%mod;\n            }\n            b = (b*b)%mod;\n            e/=2;\n        }\n        return result;\n    }\n\n    long long fac(long long n){\n        if(n==0 || n==1) return 1;\n        long long result = 1; \n        for(int i=2;i<=n;i++){\n            result = (result*i)%mod;\n        }\n        return result;\n    }\n    long long count(string s){\n        long long n = s.size();\n        long long fact = fac(n);\n        map<char,int> mp;\n        for(int i=0;i<s.size();i++) mp[s[i]]++;\n\n        for(auto mp:mp){\n            fact = (fact*mod_pow(fac(mp.second),mod-2))%mod;\n        }\n      \n       return fact;   \n    }\n    int countAnagrams(string s) {\n        long long ans = (long long)1;\n        vector<string> st;\n        for(int i=0;i<s.size();i++){\n            string str = "";\n            while(i<s.size() && s[i]!=\' \'){\n                str+=s[i];\n                i++;\n            }\n            st.push_back(str);\n        }\n        for(auto st:st){\n           ans =(ans*count(st))%mod;\n        }\n        return ans;\n    }\n};\n\n```
['C++']