Approach 1: Counting
Intuition and Algorithm
Every uncommon word occurs exactly once in total. We can count the number of occurrences of every word, then return ones that occur exactly once.
Time Complexity: , where are the lengths of
Space Complexity: , the space used by
Analysis written by: @awice.