Brute force AC solution
\tclass Solution {\n    public String[] uncommonFromSentences(String A, String B) {\n        Map map1 = oneTime(A);\n        Map map2 = oneTime(B);\n        Set
\tclass Solution {\n    public String[] uncommonFromSentences(String A, String B) {\n        Map<String, Integer> map1 = oneTime(A);\n        Map<String, Integer> map2 = oneTime(B);\n        Set<String> temp = new HashSet<>();\n        \n        for(Map.Entry<String, Integer> entry : map1.entrySet()) {\n            if(entry.getValue() == 1 && !map2.containsKey(entry.getKey())) {\n                temp.add(entry.getKey());\n            }\n        }\n        \n        for(Map.Entry<String, Integer> entry : map2.entrySet()) {\n            if(entry.getValue() == 1 && !map1.containsKey(entry.getKey())) {\n                temp.add(entry.getKey());\n            }\n        }\n        \n        String[] result = new String[temp.size()];\n        int i = 0;\n        \n        for(String s : temp) {\n            result[i++] = s;\n        }\n        return result;\n    }\n    \n    private HashMap<String, Integer> oneTime(String A) {\n        String[] str = A.split(" ");\n        HashMap<String, Integer> map = new HashMap<>();\n        \n        for(String s : str) {\n            map.put(s, map.getOrDefault(s, 0) + 1);\n        }\n        return map;\n    }}
[]