Concise Python Tire Implementation
\nclass TrieNode:\n    def __init__(self):\n        self.next = {}\n        self.score = 0\n\n\nclass Solution:\n    def sumPrefixScores(self, words: List[str])
```\nclass TrieNode:\n    def __init__(self):\n        self.next = {}\n        self.score = 0\n\n\nclass Solution:\n    def sumPrefixScores(self, words: List[str]) -> List[int]:\n        result = []\n        \n        root = TrieNode()\n        \n        # build the trie\n        for i, word in enumerate(words):\n            node = root\n            for j, c in enumerate(word):\n                if c not in node.next:\n                    node.next[c] = TrieNode()\n                node.next[c].score += 1\n                node = node.next[c]\n        \n        # get the scores\n        for i, word in enumerate(words):\n            node = root\n            sum_score = 0\n            for j, c in enumerate(word):\n                sum_score += node.score\n                node = node.next[c]\n            sum_score += node.score\n            result.append(sum_score)\n        \n        return result\n```
['Trie', 'Python']