Maximum Unique-Character Word Subset
Updated
Problem statement
Given an array of lowercase English words, choose a subset whose concatenation contains no repeated character. Return the maximum possible length of such a concatenation.
A word that repeats a character inside itself cannot be selected. The order of selected words does not affect validity, and the empty subset is allowed. Return only the maximum length, not the selected subset.
Function
maxUniqueCharacterSubsetLength(words: String[]) → intExamples
Example 1
words = ["un","iq","ue"]return = 4Selecting un and iq produces four distinct characters. Adding ue would repeat u.
Example 2
words = ["cha","r","act","ers"]return = 6Selecting cha and ers produces the six distinct characters in chaers.
Example 3
words = ["aa","bc"]return = 2The word aa is invalid because it repeats a internally. Selecting only bc gives length 2.
Constraints
0 <= words.length <= 16.1 <= words[i].length <= 26.- Every word contains only lowercase English letters.
More Meta Onsite Interview questions
- Multi-Head Attention Forward PassPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Run-Length Encoded Vector Dot ProductPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Mutual-Friend RecommendationsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Deterministic K-Means AssignmentsPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
- Linear Layer Forward and Backward PassesONSITE INTERVIEW · Seen Sep 2026
- Reservoir Sampling with Recorded DrawsONSITE INTERVIEW · Seen Sep 2026
- Stochastic Gradient Descent with MomentumONSITE INTERVIEW · Seen Sep 2026
- Top K Largest Values with a HeapONSITE INTERVIEW · Seen Sep 2026
- Partition a Card Deck into FifteensONSITE INTERVIEW · Seen Sep 2026
- Insert into a Sorted Circular ListONSITE INTERVIEW · Seen Aug 2026
Similar questions at other companies
- Insert Addition and Multiplication OperatorsPinterest · ONSITE INTERVIEWPinterest interview questions
- Generate All Valid Word AbbreviationsSalesforce · ONSITE INTERVIEWSalesforce interview questions
- SubsetsBloomberg LP · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
- SubsetsGoogle · ONSITE INTERVIEWGoogle interview questions
- Optimal Account BalancingAmazon · ONSITE INTERVIEW
- Hybrid Run-Length and Bit-Packing EncoderDatabricks · ONSITE INTERVIEWDatabricks interview questions
- Word Search IIKotak Mahindra Bank · ONSITE INTERVIEWKotak Mahindra Bank interview questions
- Largest Number Below N from Reusable DigitsByteDance · PHONE SCREENByteDance interview questions
- SubsetsTemu · PHONE SCREENTemu interview questions
- Count String Pairs With Disjoint CharactersNetflix · PHONE SCREENNetflix interview questions
Meta interview experiences
- Meta PhD SWE Intern AI Coding Phone Screen: 1 Experience
- Meta Business Support Engineer Phone Screen: 1 Experience
- Meta Software Engineer Onsite Questions: 3 Experiences
- Meta AI Native Engineer OA and Onsite: 1 Experience
- Meta AI-Native Coding Interview: 3 Experiences
- Meta Production Engineer Intern Questions: 6 Experiences