Uncommon Words from Two Sentences
Solve this the way you would in the interview: out loud, on a timer, with an AI interviewer asking follow-ups while you code. You get a scored report at the end.
Practice this as a mock interviewFree to start, no account neededProblem
A sentence is a string of lowercase words separated by single spaces. A word is **uncommon** if it appears exactly once in one of the sentences and does not appear at all in the other.
Given two sentences s1 and s2, return a list of all uncommon words. The words may be returned in **any order**; if there are none, return an empty list.
Examples
Constraints
- 1 <= s1.length, s2.length <= 200
- `s1` and `s2` consist of lowercase letters and single spaces
- Neither sentence has leading or trailing spaces
- Words are separated by exactly one space
What the interviewer grades
A correct solution is one of five scores. The report also grades problem understanding (did you clarify inputs and edge cases before coding), problem solving, communication while you work, code quality, and testing. See a sample report, or read up on the pattern in the lessons.