@@ -0,0 +1,805 @@
+package leetcode.word_pattern;%0A%0Aimport java.util.HashMap;%0A%0Apublic class Solution %7B%0A    public boolean wordPattern(String pattern, String str) %7B%0A        String%5B%5D char2Str = new String%5B26%5D;%0A        HashMap%3CString, Integer%3E str2Char = new HashMap%3CString, Integer%3E();%0A        String%5B%5D splits = str.split(%22 +%22);%0A        if(splits.length != pattern.length()) return false;%0A        int length = splits.length;%0A        for(int i = 0; i %3C length; i++)%7B%0A            String word = splits%5Bi%5D;%0A            char c = pattern.charAt(i);%0A            if(word.equals(char2Str%5Bc - 'a'%5D)) continue;%0A            if(str2Char.containsKey(word) %7C%7C char2Str%5Bc - 'a'%5D != null)%0A                return false;%0A            str2Char.put(word, (int)(c - 'a'));%0A            char2Str%5Bc - 'a'%5D = word;%0A        %7D%0A        return true;%0A    %7D%0A%7D%0A

Add solution for Word Pattern