Fundamentals/Max Length Of A Concatenated String With Unique Characters
← PrevNext →
Given an array of strings arr. String s is a concatenation of a subsequence of arr which has unique characters. Return the maximum possible length of s.
Constraints
arr[i] contains only lower case English letters.
Example 1:
Input: ["un","iq","ue"]
Output: 4
Explanation:
All possible concatenations are "","un","iq","ue","uniq" and "ique".
Example 2
Input["cha","r","act","ers"]
Output6
Explanation
Possible solutions are "chaers" and "acters".
Example 3
Input["abcdefghijklmnopqrstuvwxyz"]
Output26
Explanation
impossible to concatenate as letters won't be unique.