@@ -0,0 +1,831 @@
+public class Solution %7B%0A    public boolean wordPattern(String pattern, String str) %7B%0A        String%5B%5D words = str.split(%22%5C%5Cs+%22);%0A        if(pattern.length() != words.length) %7B%0A            return false;%0A        %7D%0A        %0A        HashMap%3CCharacter, String%3E p2s = new HashMap%3CCharacter, String%3E();%0A        HashMap%3CString, Character%3E s2p = new HashMap%3CString, Character%3E();%0A        %0A        for (int i = 0; i %3C words.length; i++) %7B%0A            char p = pattern.charAt(i);%0A            if (!p2s.containsKey(p)) %7B%0A                if (s2p.containsKey(words%5Bi%5D)) %7B%0A                    return false;%0A                %7D%0A                p2s.put(p, words%5Bi%5D);%0A                s2p.put(words%5Bi%5D, p);%0A            %7D else if (!p2s.get(p).equals(words%5Bi%5D))%7B%0A                return false;%0A            %7D%0A        %7D%0A        %0A        return true;%0A    %7D%0A%7D%0A

Create WordPattern_001.java