Don't Trie | Simple hashing!
\nclass Solution {\npublic:\n    unordered_map<long long,int> mp;\n    long long base = 31 , pw = 1 , mod = 1011001110001111;\n    vector<int> sumPrefixScores(v
```\nclass Solution {\npublic:\n    unordered_map<long long,int> mp;\n    long long base = 31 , pw = 1 , mod = 1011001110001111;\n    vector<int> sumPrefixScores(vector<string>& words) {\n         vector<int> ans;\n         for(string s : words) {\n             long long hash = 0 , pw = 1;\n             for(int j=0; j<s.size(); j++) {\n                   mp[hash = (hash + (pw * (s[j] -\'a\' + 1)) % mod)%mod]++;\n                   pw = (pw * base) % mod;\n             }\n         }\n          for(string s : words) {\n             long long hash = 0 , pw = 1;\n             int cnt = 0;\n             for(int j=0; j<s.size(); j++) {\n                   cnt+=mp[hash = (hash + (pw * (s[j] -\'a\' + 1)) % mod)%mod];\n                   pw = (pw * base) % mod;\n             }\n             ans.push_back(cnt); \n         }\n        return ans;\n    } \n};\n```
['C', 'Rolling Hash']