Simple trie
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```c []\n// Trie node structure\nstruct TrieNode {\n    struct TrieNode* child[26];\n    int freq;\n};\n\n// Function to create a new Trie node\nstruct TrieNode* getNode() {\n    struct TrieNode* node = malloc(sizeof(struct TrieNode));\n    node->freq = 0;\n    for (int i = 0; i < 26; i++) {\n        node->child[i] = NULL;\n    }\n    return node;\n}\n\n// Function to insert a key into the Trie\nvoid insert(struct TrieNode* root, const char* key) {\n    struct TrieNode* curr = root;\n    while (*key) {\n        int index = *key - 97;\n        if (!curr->child[index]) {\n            curr->child[index] = getNode();\n        }\n        curr->child[index]->freq++;\n        curr = curr->child[index];\n        key++;\n    }\n}\n\nint freq(struct TrieNode* root, const char* key) {\n    struct TrieNode* curr = root;\n    int count=0;\n    while (*key) {\n        int index = *key - 97;\n        if (!curr->child[index]) {\n            return false;\n        }\n        count+= curr->child[index]->freq;\n        curr = curr->child[index];\n        key++;\n    }\n    return count;\n}\n\n/**\n * Note: The returned array must be malloced, assume caller calls free().\n */\nint* sumPrefixScores(char** words, int wordsSize, int* returnSize) {\n    *returnSize=wordsSize;\n    int *res=malloc(wordsSize*sizeof(int));\n    struct TrieNode* root = getNode();\n    //generate the trie\n    for (int i = 0; i < wordsSize; i++) {\n        insert(root, words[i]);\n    }\n    //count the frequency of letter from each words\n    for (int i=0;i < wordsSize;i++)  {\n        res[i]= freq(root,words[i]);\n    }\n    \n    return res;\n}\n```
['Trie', 'C']