@@ -0,0 +1,808 @@
+/**%0A * Problem Link: https://leetcode.com/problems/word-pattern/%0A */%0Aimport java.util.*;%0A%0Apublic class Solution %7B%0A    public boolean wordPattern(String pattern, String str) %7B%0A        String%5B%5D ss = str.split(%22 %22);%0A        HashMap%3CString, String%3E map = new HashMap%3CString, String%3E();%0A        %0A        if(ss.length != pattern.length()) return false;%0A        %0A        for(int i=0; i%3Css.length; i++) %7B%0A            String c = %22%22 + pattern.charAt(i);%0A            String s = ss%5Bi%5D;%0A            if(map.get(c) == null && map.get(s) == null) %7B%0A                map.put(c, s);%0A                map.put(s, c);%0A            %7D else if(map.get(c) == null %7C%7C map.get(s) == null %7C%7C map.get(c).compareTo(s) != 0 %7C%7C map.get(s).compareTo(c) != 0) %7B%0A                return false;%0A            %7D%0A        %7D%0A        return true;%0A    %7D%0A%7D%0A

Create Word_Pattern.java