✅ ✅ Beats 100% ✅ ✅  in java. Using HASHMAP.
Intuition\n Describe your first thoughts on how to solve this problem. \nUse hashmap to store all the words including their count.\n\n# Approach\nSire all the w
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nUse hashmap to store all the words including their count.\n\n# Approach\nSire all the words in an array that appear only once.\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n- O(s1.length()+s2.length())\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n- O(s1+s2)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```java []\nclass Solution {\n    public String[] uncommonFromSentences(String s1, String s2) {\n        Map<String,Integer> m=new HashMap<>();\n        int i=0;int j=0;\n        while(i<s1.length())\n        {\n            if(s1.charAt(i)==\' \')\n            {\n                m.put(s1.substring(j,i),m.getOrDefault(s1.substring(j,i),0)+1);\n                j=i+1;\n            }\n            i++;\n        }\n        m.put(s1.substring(j,i),m.getOrDefault(s1.substring(j,i),0)+1);\n        i=0;j=0;\n        while(i<s2.length())\n        {\n            if(s2.charAt(i)==\' \')\n            {\n                m.put(s2.substring(j,i),m.getOrDefault(s2.substring(j,i),0)+1);\n                j=i+1;\n            }\n            i++;\n        }\n        m.put(s2.substring(j,i),m.getOrDefault(s2.substring(j,i),0)+1);\n        i=0;j=0;\n        for(String s:m.keySet())\n        {\n            if(m.get(s)==1)\n            {\n                i++;\n            }\n        }\n        String s3[]=new String[i];\n        for(String s:m.keySet())\n        {\n            if(m.get(s)==1)\n            {\n                s3[j]=s;\n                j++;\n            }\n        }\n        return s3;\n    }\n}\n```
['Java']