Easy Java Solution
Some thoughts:\nIt may not be necessary to implement the trie for this problem.\nThe time complexity and space complexity are the same.\nAnd in some cases, trie
Some thoughts:\nIt may not be necessary to implement the trie for this problem.\nThe time complexity and space complexity are the same.\nAnd in some cases, trie version might be even slower? \n\n```\nclass MagicDictionary {\n\n    HashSet<String> dictSet;\n    \n    /** Initialize your data structure here. */\n    public MagicDictionary() {\n        dictSet = new HashSet<>();\n    }\n    \n    /** Build a dictionary through a list of words */\n    public void buildDict(String[] dict) {\n        dictSet = new HashSet<String>();\n        for(String word : dict)\n            dictSet.add(word);\n    }\n    \n    /** Returns if there is any word in the trie that equals to the given word after modifying exactly one character */\n    public boolean search(String word) {\n        char[] chars = word.toCharArray();\n        for(int i = 0; i < chars.length; i++){\n            char ch = chars[i];\n            for (char c = 'a'; c <= 'z'; c++){\n                if (c != ch){\n                    chars[i] = c;\n                    if (dictSet.contains(new String(chars)))\n                        return true;\n                }\n            }\n            chars[i] = ch;\n        }\n        return false;\n    }\n}\n```
[]