#884
Uncommon Words from Two Sentences
newbie · 230 · lc easy +17 · 75.6% accepted · 1,897 likes · top 87%
Description
A sentence consists of space-separated lowercase words.
A word is uncommon if it appears exactly once across both sentences combined and does not appear in the other sentence.
Given two sentences s1 and s2, return all uncommon words. The result may be returned in any order.
Code
1
2
3