Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 16d496d

Browse files
Time: 35 ms (59.61%), Space: 16.6 MB (5.76%) - LeetHub
1 parent 9cb79d2 commit 16d496d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from collections import Counter
2+
class Solution:
3+
def uncommonFromSentences(self, s1: str, s2: str) -> List[str]:
4+
words1=s1.split()
5+
words2=s2.split()
6+
count1=Counter(words1)
7+
count2=Counter(words2)
8+
combined_count=count1+count2
9+
uncommon_words=[word for word,count in combined_count.items() if count==1]
10+
return uncommon_words
11+
12+
13+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /