884-Uncommon-Words-From-Two-Sentences
Sat 17 May 2025
https://leetcode.com/problems/uncommon-words-from-two-sentences
import pyutil as pyu
pyu.get_local_pyinfo()
print(pyu.ps2("python-dotenv"))
from typing import List
class Solution:
def uncommonFromSentences(self, A: str, B: str) -> List[str]:
count = Counter((A + ' ' + B).split())
return [word for word, freq in count.items() if freq == 1]
new Solution().uncommonFromSentences()
Score: 5
Category: leetcode