SIMPLE TRIE | C++ | BRUTE FORCE
TRIE PRACTICE PROBLEMS \n\n1. Implement Trie (Prefix Tree)\n2. Maximum XOR of Two Numbers in an Array\n3. Search Suggestions System\n\n// trie node  \nstruct no
**TRIE PRACTICE PROBLEMS **\n\n[1. Implement Trie (Prefix Tree)](https://leetcode.com/problems/implement-trie-prefix-tree/)\n[2. Maximum XOR of Two Numbers in an Array](https://leetcode.com/problems/maximum-xor-of-two-numbers-in-an-array/)\n[3. Search Suggestions System](https://leetcode.com/problems/search-suggestions-system/)\n```\n// trie node  \nstruct node{\n    int count;\n    node* child[26];\n    node(){\n        for(int i=0;i<26;i++){\n            child[i]=NULL;\n        }\n        count=0;\n    }\n};\n\nclass Solution{\npublic:\n    vector<int> sumPrefixScores(vector<string>& words){\n        vector<int> ans;\n        node* root=new node();\n        \n        //inserting words in trie \n        for(auto s:words){\n            int n=s.length();\n            node* temp=root;\n            for(int i=0;i<n;i++){\n                if(temp->child[s[i]-\'a\']==NULL){\n                    temp->child[s[i]-\'a\']=new node();\n                }\n                temp=temp->child[s[i]-\'a\'];\n                \n                //updating count of that prefix  \n                temp->count++;\n            }\n        }\n        \n        //traversing to each words \n        for(auto s:words){\n            int n=s.length();\n            int curr=0;\n            node* temp=root;\n            //suming up value of each prefix \n            for(int i=0;i<n;i++){\n                temp = temp->child[s[i]-\'a\'];\n                curr += temp->count;\n            }\n            //updating ans to that word \n            ans.push_back(curr);\n        }\n        \n        return ans;\n    }\n};\n\n\n\n\n\n\n\n```
['Depth-First Search', 'Trie', 'C']