@@ -0,0 +1,1770 @@
+class Solution %7B%0A    public TrieNode root = new TrieNode();%0A    %0A    public void dfs(Set%3CString%3E ret, int i, int j, char%5B%5D%5B%5D board, TrieNode root, boolean%5B%5D%5B%5D visited) %7B%0A        if(root != null && root.s != null) ret.add(root.s);%0A        if(i %3C 0 %7C%7C i %3E= board.length %7C%7C j %3C 0 %7C%7C j %3E= board%5B0%5D.length %7C%7C visited%5Bi%5D%5Bj%5D %7C%7C root == null ) return; %0A        visited%5Bi%5D%5Bj%5D = true; %0A        dfs(ret, i - 1, j, board, root.children%5Bboard%5Bi%5D%5Bj%5D - 'a'%5D, visited);%0A        dfs(ret, i + 1, j, board, root.children%5Bboard%5Bi%5D%5Bj%5D - 'a'%5D, visited);%0A        dfs(ret, i, j - 1, board, root.children%5Bboard%5Bi%5D%5Bj%5D - 'a'%5D, visited);%0A        dfs(ret, i, j + 1, board, root.children%5Bboard%5Bi%5D%5Bj%5D - 'a'%5D, visited);%0A        visited%5Bi%5D%5Bj%5D = false; %0A    %7D%0A    public void insert(TrieNode cur, String word) %7B%0A        for(int i = 0; i %3C word.length(); i++) %7B%0A            int index = word.charAt(i) - 'a';%0A            if(cur.children%5Bindex%5D == null) %7B%0A                cur.children%5Bindex%5D = new TrieNode();%0A            %7D%0A            cur = cur.children%5Bindex%5D;%0A        %7D%0A        cur.s = word;%0A    %7D%0A    public List%3CString%3E findWords(char%5B%5D%5B%5D board, String%5B%5D words) %7B%0A        Set%3CString%3E ret = new HashSet%3C%3E(); %0A        if(words == null %7C%7C words.length == 0) return new ArrayList%3C%3E();%0A        for(String word : words) insert(root, word);%0A        for(int i = 0; i %3C board.length; i++) %7B%0A            for(int j = 0; j %3C board%5B0%5D.length; j++) %7B%0A                boolean%5B%5D%5B%5D visited = new boolean%5Bboard.length%5D%5Bboard%5B0%5D.length%5D; %0A                dfs(ret, i, j, board, root, visited);%0A            %7D%0A        %7D%0A        List%3CString%3E ans = new ArrayList%3C%3E(); %0A        for(String s : ret) ans.add(s);%0A        %0A        return  ans;%0A    %7D%0A%7D%0A%0Aclass TrieNode %7B%0A    String s; %0A    TrieNode%5B%5D children = new TrieNode%5B26%5D;%0A%7D%0A

Create lc212.java