trie
class MagicDictionary {\npublic:\n    struct node\n    {\n        char val;\n        nodearr[26]={NULL};\n        bool isend;\n        node(char ch)\n        {\
class MagicDictionary {\npublic:\n    struct node\n    {\n        char val;\n        node*arr[26]={NULL};\n        bool isend;\n        node(char ch)\n        {\n            val=ch;\n            isend=false;\n        }\n    };\n    node*root=new node(\'\\0\');\n    void insert(string word)\n    {\n        node*temp=root;\n        for(int i=0;i<word.size();i++)\n        {\n            if(temp->arr[word[i]-\'a\']==NULL)\n            {\n                temp->arr[word[i]-\'a\']=new node(word[i]);\n            }\n            temp=temp->arr[word[i]-\'a\'];\n        }\n        temp->isend=true;\n    }\n    \n    \n    MagicDictionary() {\n        \n    }\n    \n    void buildDict(vector<string> words) {\n        \n        for(int i=0;i<words.size();i++)\n        {\n            insert(words[i]);\n        }\n        \n    }\n    \n    bool Search(node*temp,string word,int ind,int count)\n    {\n        if(ind==word.size()  && count==0 && temp->isend==true)\n        {\n            return true;\n        }\n        if(temp==NULL)\n        {\n            return false;\n        }\n        if(ind==word.size() && count!=0)\n        {\n            return false;\n        }\n        if(ind>=word.size())\n        {\n            return false;\n        }\n        if(count==0 && temp->arr[word[ind]-\'a\']==NULL) \n        {\n            return false;\n        }\n        bool res=false;\n        for(int i=0;i<26;i++)\n        {\n            if(temp->arr[i]!=NULL && (word[ind]-\'a\')!=i && count==1)\n            {\n                bool ans=Search(temp->arr[i],word,ind+1,count-1);\n                res|=ans;\n            }\n        }\n        return res | Search(temp->arr[word[ind]-\'a\'],word,ind+1,count);\n    }\n    \n    bool search(string word) {\n        \n        return Search(root,word,0,1);\n        \n    }\n};\n\n/**\n * Your MagicDictionary object will be instantiated and called as such:\n * MagicDictionary* obj = new MagicDictionary();\n * obj->buildDict(dictionary);\n * bool param_2 = obj->search(searchWord);\n */
['Trie', 'C', 'C++']