Leetcode 884. Uncommon Words from Two Sentences

Posted 周洋的Blog

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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]

 

以上是关于Leetcode 884. Uncommon Words from Two Sentences的主要内容,如果未能解决你的问题,请参考以下文章

[LeetCode] 884. Uncommon Words from Two Sentences_Easy tag: Hash Table

LeetCode Longest Uncommon Subsequence II

#Leetcode# 521. Longest Uncommon Subsequence I

LeetCode 521. Longest Uncommon Subsequence I

[LeetCode] 522. Longest Uncommon Subsequence II

LeetCode 521 Longest Uncommon Subsequence I 解题报告