Easy Solution || C++ || Tries || TC- O(N*L)
Intuition\nWhen solving this problem, the main challenge is calculating the prefix scores efficiently for multiple words. A brute force approach of calculating 
# Intuition\nWhen solving this problem, the main challenge is calculating the prefix scores efficiently for multiple words. A brute force approach of calculating prefix scores individually for each word would be inefficient, especially with longer word lists. The Trie (prefix tree) data structure is well-suited for problems involving prefixes, as it allows us to store common prefixes and retrieve them efficiently\uD83D\uDE0E.\n\n# Approach\n1. Trie Construction:\n\n    - We construct a Trie where each node represents a character in the word.\n    - As we insert words into the Trie, we maintain a count for each node, which keeps track of how many words pass through this node (or how many words have this character as part of their prefix). This is crucial for computing the prefix score later.\n\n2. Prefix Score Calculation:\n\n    - Once the Trie is constructed, we can calculate the prefix score of each word.\n    - For each word, we traverse the Trie and accumulate the count values for each character in the word. The sum of these counts gives us the prefix score for that word.\nEfficiency:\n\nUsing a Trie ensures that common prefixes are only processed once, making the solution more efficient than processing each word from scratch.\n\n# Complexity\n**- *Time complexity:  O(n * L)***\n\n**- *Space complexity: O(n)***\n\n# Code\n```cpp []\nclass TrieNode{\n    public:\n    TrieNode* children[26] = {0};\n    int count = 0;\n};\n\nclass Trie{\n    public:\n     TrieNode* root;\n    \n     Trie() {\n        root = new TrieNode();\n     }\n\n     void insert(const string& word){\n        TrieNode* node = root;\n        for(char c:word){\n            int idx = c - \'a\';\n            if(!node->children[idx]){\n                node->children[idx]=new TrieNode;\n            }\n            node = node->children[idx];\n            node->count++;\n        }\n     }\n\n     int getPrefixScore(const string& word){\n        TrieNode* node = root;\n        int score = 0;\n        for(char c:word){\n            int idx = c - \'a\';\n            if(node ->children[idx]){\n                node = node->children[idx];\n                score += node->count;\n            }\n        }\n        return score;\n     }\n};\n\nclass Solution {\n    public:\n    vector<int> sumPrefixScores(vector<string>& words) {\n        Trie trie;\n\n        for(const string& word:words){\n            trie.insert(word);\n        }\n        vector<int> result;\n\n        for(const string& word:words){\n            int score = trie.getPrefixScore(word);\n            result.push_back(score);\n        }\n        return result;\n    }\n};\n```
['Array', 'String', 'Trie', 'Counting', 'C++']