JAVA_Uncommon Words from Two Sentences_LeetCode 884 풀이 class Solution { public String[] uncommonFromSentences(String s1, String s2) { Map<String,Integer> map = new HashMap<>(); ArrayList<String> list = new ArrayList<>(); for(String str : s1.split(" ")) map.put(str,map.getOrDefault(str,0) + 1); for(String str : s2.split(" ")) map.put(str,map.getOrDefault(str,0) + 1); for(Map.Entry<String,Integer> map2 : map.entrySet()){ if(map2.getValue() == 1) list.add(map2.getKey()); } return list.toArray(new S...
#JAVA
#JAVA_LeetCode884
#JAVA_UncommonWordsfromTwoSentences
#JAVA_UncommonWordsfromTwoSentences_LeetCode884
#UncommonWordsfromTwoSentences_LeetCode884
원문링크 : JAVA_Uncommon Words from Two Sentences_LeetCode 884