simple and easy Python solution || Trie
if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n\n###### Let\'s Connect on LinkedIn: www.linkedin.com/in/shishirrsiam\n###### Let\'s Connect on Facebook: ww
# if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n\n###### Let\'s Connect on LinkedIn: www.linkedin.com/in/shishirrsiam\n###### Let\'s Connect on Facebook: www.fb.com/shishirrsiam\n\n\n\n# Complexity\n- Time complexity: O(n * l)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n\n# Code\n```python3 []\nclass TrieNode:\n    def __init__(self):\n        self.count = 0\n        self.children = [None] * 26\n\nclass Solution:\n    def sumPrefixScores(self, words: List[str]) -> List[int]:\n        root = TrieNode()\n\n        for w in words:\n            node = root\n            for ch in w:\n                index = ord(ch) - ord(\'a\')\n                if not node.children[index]:\n                    node.children[index] = TrieNode()\n                node = node.children[index]\n                node.count += 1\n\n        ans = []\n        for w in words:\n            sum = 0\n            node = root\n            for ch in w:\n                index = ord(ch) - ord(\'a\')\n                node = node.children[index]\n                sum += node.count\n            ans.append(sum)\n        return ans\n```
['Array', 'String', 'Trie', 'Counting', 'Python', 'Python3']