This question evaluates algorithmic problem-solving skills focused on combinatorial subset selection and character-uniqueness constraints in strings, within the Coding & Algorithms domain.
You are given a list of strings words. You may select any subset of these strings (each string used at most once) and concatenate them in any order.
A concatenation is valid if no character appears more than once in the final concatenated string.
Return the maximum possible length of a valid concatenation.
words: List[str]
int
= maximum valid concatenation length
1 <= len(words) <= 20
a-z
1 <= len(word) <= 26
words = ["un","iq","ue"]
→
4
("uniq" or "ique")
words = ["aa","bc"]
→
2
(skip "aa", take "bc")