Python3 ✅ || Simple Trie
`.\nclass TrieNode:\n        def __init__(self):\n            self.children = {}\n            self.word = False\n            self.count = 1\n            \nclass
```.\nclass TrieNode:\n        def __init__(self):\n            self.children = {}\n            self.word = False\n            self.count = 1\n            \nclass Trie:\n    def __init__(self):\n        self.root = TrieNode()\n\n    def insert(self, word):\n        trav = self.root\n        for c in word:\n            if c in trav.children:\n                trav.children[c].count += 1\n                trav = trav.children[c]\n            else:\n                trav.children[c] = TrieNode()\n                trav = trav.children[c]\n        trav.word = True\n\nclass Solution:\n    \n        \n    def sumPrefixScores(self, words: List[str]) -> List[int]:\n        \n        trie = Trie()\n        \n        for word in words:\n            trie.insert(word)\n        \n        ans = []\n        for word in words:\n            count = 0\n            trav = trie.root\n            for c in word:\n                if c in trav.children:\n                    count += trav.children[c].count\n                    trav = trav.children[c]\n            ans.append(count)\n            \n        return ans\n \xA0 \xA0 ``
[]