count Anagrams || Unordered_map || Easy to  understand💯
\n\n# Code\n\n#define ll long long \nclass Solution {\npublic:\n     int m = 1000000007;\n        vector<long long > fact;\n        void solve(){\n            f
\n\n# Code\n```\n#define ll long long \nclass Solution {\npublic:\n     int m = 1000000007;\n        vector<long long > fact;\n        void solve(){\n            fact[0] = fact[1] =1 ;\n            for(int i=2;i<100001;i++){\n                fact[i] = (fact[i-1]%m * i%m )%m;\n            }\n        }\n    ll powmod(ll a, ll b){\n         ll res = 1;\n         while(b>0){\n             if(b%2 == 1)res= res*a % m;\n        a= a*a % m;\n         b = b/2;\n         }\n         return res;\n    }\n    ll inverse(ll n){\n        return powmod(n,m-2);\n    }\n    int countAnagrams(string s) {\n        fact.resize(100001);\n        solve();\n       ll ans =1 , cnt=0;\n       unordered_map<char,int>freq;\n       s+=\' \';\n       for(int i=0;i<s.size();i++){\n           if(s[i]==\' \'){\n               ll val = fact[cnt];\n               for(auto c : freq){\n                   val  = val * inverse(fact[c.second])%m;\n               }\n            ans= ans*val % m;\n            cnt=0;\n            freq.clear();\n           }\n           else{\n               cnt++;\n               freq[s[i]]++;\n           }\n       }\n       return ans;\n    }\n};\n```
['Ordered Map', 'C++']