Concatenated Words
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
You are given an array of **distinct** non-empty strings words. A word is **concatenated** if it can be written as a concatenation of **two or more** words from the array, where each piece is a word other than the whole word itself. The same piece may be used more than once.
Return every concatenated word, in the **same order** they appear in words. Return an empty list if there are none.
Examples
Constraints
- `1 <= words.length <= 10^4`
- `1 <= words[i].length <= 30`
- `words[i]` consists of lowercase English letters
- All strings in `words` are distinct
- `sum(words[i].length) <= 10^5`
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.