Java 8 solution | using Map | Easy to understand
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass MagicDictionary {\n\n   Map<Integer, List<String>> map;\n    \n    public MagicDictionary() {\n    }\n    \n    public void buildDict(String[] dictionary) {\n        map = Arrays.stream(dictionary).collect(Collectors.groupingBy(String::length));\n    }\n\n    public boolean search(String searchWord) {\n        var length = searchWord.length();\n        if (!map.containsKey(length)) {\n            return false;\n        }\n        var list = map.get(length);\n\n        for (var str : list) {\n            var start = 0;\n            var end = str.length() - 1;\n            var count = 0;\n            while (start <= end) {\n                if (count > 1) {\n                    break;\n                }\n                if (str.charAt(start) != searchWord.charAt(start)) {\n                    count++;\n                }\n                if (end != start && str.charAt(end) != searchWord.charAt(end)) {\n                    count++;\n                }\n                start++;\n                end--;\n            }\n            if (count == 1) {\n                return true;\n            }\n        }\n        return false;\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 * boolean param_2 = obj.search(searchWord);\n */\n```
['Java']