Easy Java Solution No extra space
class MagicDictionary {\n    \n\tString[] magicDictionary;\n    public MagicDictionary() {}\n    \n    public void buildDict(String[] dictionary) {\n        mag
class MagicDictionary {\n    \n\tString[] magicDictionary;\n    public MagicDictionary() {}\n    \n    public void buildDict(String[] dictionary) {\n        magicDictionary = dictionary;\n    }\n    \n    public boolean canMatch(String searchWord , String dictWord){\n        if(dictWord.length() == searchWord.length() && !searchWord.equals(dictWord))\n            for(int i = 0 ; i < dictWord.length() ; i++)\n                if(searchWord.charAt(i) != dictWord.charAt(i)) \n                    return searchWord.substring(i+1).equals(dictWord.substring(i+1));\n            \n        return false;\n    }\n    \n    public boolean search(String searchWord) {\n        for(String dictWord : magicDictionary){\n            if(canMatch(searchWord , dictWord)) return true;\n        }\n        return false;\n    }\n}
['Java']