easy to understandable solution with 100% beats
\n\n# Code\njava []\nclass Solution {\n    public String[] uncommonFromSentences(String s1, String s2) {\n        String str1[]=s1.split(" ");\n        String s
\n\n# Code\n```java []\nclass Solution {\n    public String[] uncommonFromSentences(String s1, String s2) {\n        String str1[]=s1.split(" ");\n        String str2[]=s2.split(" ");\n       \n\n        HashMap<String, Integer>wordCount=new HashMap<>();\n        for(String str:str1)\n        {\n           wordCount.put(str, wordCount.getOrDefault(str, 0)+1);\n        }\n          for(String str:str2)\n        {\n            wordCount.put(str, wordCount.getOrDefault(str, 0)+1);\n        }\n         ArrayList<String>list=new ArrayList<>();\n         for(String str:wordCount.keySet())\n         {\n            if(wordCount.get(str)==1)\n            {\n                list.add(str);\n            }\n         }\n        return list.toArray(new String[list.size()]);\n    }\n}\n```\n![upvote image leet.jpeg](https://assets.leetcode.com/users/images/8eae4fb9-aedb-4f51-8c77-f6fcd99732b5_1726547822.9172795.jpeg)\n
['Java']