[EASY] Simplified explantion of logic (using Trie Data Structure):
Intuition\nThe problem asks us to compute the sum of prefix scores for each word in the given list. A prefix score is the total number of words in the list that
# Intuition\nThe problem asks us to compute the sum of prefix scores for each word in the given list. A prefix score is the total number of words in the list that share the same prefix, up to every letter in the word.\n\nTo efficiently solve this problem, we can leverage a **Trie** (prefix tree). Tries are well-suited for problems involving prefixes, as they allow us to store and count the occurrence of prefixes across multiple words.\n\nThe key insight is to insert each word into the Trie while counting how many words pass through each node (which corresponds to a character in a prefix). Once all words are inserted, we can compute the prefix score for each word by summing the counts of nodes visited while traversing the Trie.\n\n# Approach\n1. **Trie Construction**:\n    - First, we define a `Node` class to represent each node in the Trie. Each node stores an array for child nodes (`self.char`), one for each letter of the alphabet, and a counter (`self.count`) to track how many words pass through this node.\n    - In the `Solution` class, we initialize the Trie by creating the root node.\n\n2. **Insert Function**:\n    - For each word, we traverse the Trie, creating new nodes as necessary for each character. While traversing, we increment the `count` of each node to record how many words share the prefix leading to that node.\n\n3. **Calculate Prefix Scores**:\n    - After building the Trie, for each word, we again traverse the Trie and sum the `count` values of the nodes along the path defined by the word\u2019s characters. This sum gives us the total prefix score for the word.\n\n4. **Result**:\n    - We repeat the above for each word and store the results in a list to be returned.\n\n# Complexity\n- **Time Complexity**:  \n    The time complexity is $$O(n \\cdot m)$$, where `n` is the number of words, and `m` is the maximum length of a word. Each insertion and traversal through the Trie takes $$O(m)$$, and we do this for each word.\n  \n- **Space Complexity**:  \n    The space complexity is also $$O(n \\cdot m)$$, as the Trie may contain up to `n * m` nodes in the worst case, where `n` is the number of words and `m` is the average word length.\n\n# Code\n```python3\n# Node class representing a single character in the Trie\nclass Node:\n    def __init__(self):\n        # Each node has 26 possible children (for \'a\' to \'z\')\n        self.char = [None] * 26\n        # Count keeps track of how many words have passed through this node\n        self.count = 0\n\n# Solution class that uses the Trie to solve the problem\nclass Solution:\n    def __init__(self):\n        # Root of the Trie is an empty node\n        self.root = Node()\n    \n    # Inserts a word into the Trie and updates the count of each node\n    def insert(self, word):\n        curr = self.root\n        for c in word:\n            # Calculate index of the character (0 for \'a\', 25 for \'z\')\n            idx = ord(c) - ord(\'a\')\n            # If no node exists for this character, create one\n            if curr.char[idx] is None:\n                curr.char[idx] = Node()\n            # Move to the next node in the Trie\n            curr = curr.char[idx]\n            # Increment the count for the current node (since a word passes through it)\n            curr.count += 1\n\n    # Computes the prefix scores for each word in the input list\n    def sumPrefixScores(self, words: List[str]) -> List[int]:\n        # First, insert all words into the Trie\n        for word in words:\n            self.insert(word)\n\n        ans = []\n        # For each word, calculate the prefix score\n        for word in words:\n            curr = self.root\n            currans = 0\n            # Traverse the Trie and sum the counts along the path of the word\n            for c in word:\n                idx = ord(c) - ord(\'a\')\n                curr = curr.char[idx]\n                # Add the count of the current node to the result\n                currans += curr.count\n            # Append the total prefix score for the current word\n            ans.append(currans)\n        \n        return ans
['Trie', 'Python3']