Maximum Length of a Concatenated String with Unique Characters
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 lowercase strings arr. Pick any subsequence of arr (keep some strings, in their original order, possibly none) and concatenate the chosen strings into one string s.
The concatenation is valid only if every character in s is unique. Return the maximum possible length of a valid s. Choosing no strings gives the empty string, so the answer is at least 0.
Note that a string with a repeated character inside it can never be part of a valid choice.
Examples
Constraints
- 1 <= arr.length <= 16
- 1 <= arr[i].length <= 26
- `arr[i]` contains only lowercase English letters
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.