[Java] Trie
```\nstatic class TrieTree {\n\n        TrieNode root = new TrieNode(\' \');\n\n        public void insert(String s) {\n            TrieNode current = root;\n  
```\nstatic class TrieTree {\n\n        TrieNode root = new TrieNode(\' \');\n\n        public void insert(String s) {\n            TrieNode current = root;\n            for (char c : s.toCharArray()) {\n                current = current.children.computeIfAbsent(c, k -> new TrieNode(c));\n            }\n            current.isWord = true;\n            current.fullWord = s;\n        }\n\n        //Allow max 1 wrong character and still return found.\n        // E.g. Trie has hello and hollo, but would still return true for hallo because it has only 1 wrong char\n        public boolean searchWithMax1WrongChar(String searchWord, int beginIndex, TrieTree.TrieNode root, boolean usedWildcard) {\n            for (int i = beginIndex; i < searchWord.length(); i++) {\n                char data = searchWord.charAt(i);\n                //Use the boolean "usedWildcard" as a single-use possibility to ignore 1 char\n                if (!usedWildcard) {\n                    for (TrieTree.TrieNode child : root.children.values()) {\n                        if (searchWithMax1WrongChar(searchWord, i + 1, child, true)) {\n                            return true;\n                        }\n                    }\n                }\n                if (!root.children.containsKey(data)) {\n                    return false;\n                }\n                root = root.children.get(data);\n            }\n            return root.isWord && !root.fullWord.equals(searchWord);\n        }\n\n        public boolean searchWithMax1WrongChar(String searchWord) {\n            return searchWithMax1WrongChar(searchWord, 0, root, false);\n        }\n\n        static class TrieNode {\n            char val;\n            boolean isWord;\n            String fullWord;\n            Map<Character, TrieNode> children;\n\n            public TrieNode(char val) {\n                this.val = val;\n                this.isWord = false;\n                this.children = new HashMap<>();\n            }\n        }\n    }\n\n    TrieTree trie;\n\n    public Trie1WrongChar() {\n\n    }\n\n    public void buildDict(String[] dictionary) {\n        this.trie = new TrieTree();\n        for (String word : dictionary) {\n            trie.insert(word);\n        }\n\n    }\n\n    public boolean search(String searchWord) {\n        return trie.searchWithMax1WrongChar(searchWord);\n    }
['Trie']