Longest Sticker Banner Built From Words With No Repeated Letter
Last updated: November 29, 2026
Quick Overview
Given a list of lowercase words, choose a subset to concatenate into a banner in which no letter appears twice, and return the maximum possible banner length.
Meta
November 29, 20260
0
0 solved
Given a list of lowercase words, choose a subset to concatenate into a banner in which no letter appears twice, and return the maximum possible banner length.
Framed around building a sticker banner from letter tiles, this Meta onsite problem combines backtracking with bitmask state. The interviewer checks that you precompute masks, discard self-repeating words, and prune with constant-time overlap tests.
What the Interviewer Expects
- Convert each word to a 26-bit letter mask
- Discard words that repeat a letter internally
- Backtrack over include or skip with a used mask
- Test conflicts with a single AND
- Discuss pruning by remaining possible length
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- How would you return the chosen words, not just the length?
- What if the alphabet were 10,000 symbols instead of 26?
- Can you add an upper bound prune using the letters still available?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
- Up to 16 words, each up to 26 lowercase letters.
- Order of concatenation does not affect validity, so we choose a subset.
- Return the max total length (0 if nothing fits)....
High-Level Design
Map each word to a bitmask of its letters; if a letter appears twice in the word, the word can never be used. Then search subsets in index order with a running used mask: a word can be added only if...