Very simple Python trie code
```\nclass Solution:\n    def sumPrefixScores(self, words: List[str]) -> List[int]:\n        trie = {}\n        \n        for word in words:\n            t = tr
```\nclass Solution:\n    def sumPrefixScores(self, words: List[str]) -> List[int]:\n        trie = {}\n        \n        for word in words:\n            t = trie\n            for char in word:\n                if char not in t:\n                    t[char] = {}\n                t = t[char]\n                if \'$\' not in t:\n                    t[\'$\'] = 0\n                t[\'$\'] += 1\n        \n        ans = []\n        \n        for word in words:\n            t = trie\n            temp_ans = 0\n            for char in word:\n                t = t[char]\n                temp_ans += t[\'$\']\n            ans.append(temp_ans)\n        return ans \n
[]