Given an array of integers, every element appears twice except for one 😧
Find that lonely number !!
Example 1:
Input: [3,3,1]
Output: 1
Example 2:
Input: [4,6,9,6,9]
Output: 4
Uncommon Words from Two Sentences
given two sentences A
and B
.
sentence is a string of space separated words. Each word consists only of lowercase letters.
A word is uncommon if it appears exactly once in one of the sentences, and does not appear in the other sentence.
Return a list of all uncommon words.
You may return the list in any order.
Example 1:
Input:
A = "i love express it is awesome",
B = "i love express it is cool"
Output: ["awesome","cool"]
Example 2:
Input:
A = "ruby ruby",
B = "rails"
Output: ["rails"]