Easy 10 line java code || Beats 100% || Easier Than Easy
\n\n\n# Code\njava []\nclass Solution {\n    public String[] uncommonFromSentences(String s1, String s2) {\n        List<String> list = new ArrayList<>();\n    
\n![6c3f759d-a2ee-44bc-86a2-319fa9991c17_1718074709.4420424.jpeg](https://assets.leetcode.com/users/images/a90fff16-c1f9-45b2-8678-d79e75bfd08d_1726546272.0254323.jpeg)\n\n# Code\n```java []\nclass Solution {\n    public String[] uncommonFromSentences(String s1, String s2) {\n        List<String> list = new ArrayList<>();\n        HashMap<String, Integer> map = new HashMap();\n        String s1Str[] = s1.split(" ");\n\n        for (String word : s1Str) {\n            map.put(word, map.getOrDefault(word, 0) + 1);\n        }\n        String s2Str[] = s2.split(" ");\n\n        for (String word : s2Str) {\n            map.put(word, map.getOrDefault(word, 0) + 1);\n        }\n\n        for (String i : map.keySet()) {\n\n            if (map.get(i) == 1) {\n                list.add(i);\n            }\n        }\n        String ans[] = new String[list.size()];\n        for (int i = 0; i < list.size(); i++) {\n            ans[i] = list.get(i);\n        }\n        return ans;\n    }\n}\n```
['Array', 'Hash Table', 'String', 'Counting', 'Java']