JAVA SOLUTION | | 100% LESS MEMORY USE | | ~78.64% FASTER
\nclass MagicDictionary {\n     HashSet<String> hs; \n    public MagicDictionary() {\n        hs = new HashSet<>();\n    }\n    \n    public void buildDict(Stri
```\nclass MagicDictionary {\n     HashSet<String> hs; \n    public MagicDictionary() {\n        hs = new HashSet<>();\n    }\n    \n    public void buildDict(String[] dictionary) {\n       for(String s:dictionary){\n           hs.add(s);\n       }\n    }\n    \n    public boolean search(String searchWord) {\n        for(String s:hs){\n            if(s.length()==searchWord.length()){\n                int cnt = 0;\n                for(int i = 0;i<searchWord.length();i++){\n                    if(s.charAt(i)!=searchWord.charAt(i))cnt++;\n                }\n                if(cnt==1) return true;\n            }\n        }\n        return false;\n    }\n}\n\n```
['Java']