Leetcode 884. Uncommon Words from Two Sentences

class Solution:
    def uncommonFromSentences(self, A: str, B: str) -> List[str]:
        return [v for v, n in collections.Counter(A.split()+B.split()).items() if n == 1]

 

posted @ 2019-04-13 09:58  周洋  阅读(96)  评论(0编辑  收藏  举报