[Python3] Efficient one-liner
Here\'s my efficient one-liner:\n\n\nclass Solution:\n    def uncommonFromSentences(self, A: str, B: str) -> List[str]:\n        return [word for word, cnt in C
Here\'s my efficient one-liner:\n\n```\nclass Solution:\n    def uncommonFromSentences(self, A: str, B: str) -> List[str]:\n        return [word for word, cnt in Counter(chain(A.split(), B.split())).items() if cnt == 1]\n```\n\nUsing `chain` avoids a step of concatenation, and directly iterates over words from `A` then `B`. `Counter` and `chain` are respectively from the `collections` and `itertools` modules.\n\nI reached 16ms (99.93%) with that code.
[]