1239. Maximum Length of a Concatenated String with Unique Characters
Description
Given an array of strings arr. String s is a concatenation of a sub-sequence of arr which have unique characters.
Return the maximum possible length of s.
Constraints
1 <= arr.length <= 161 <= arr[i].length <= 26arr[i]contains only lower case English letters.
Approach
Links
GeeksforGeeks
ProgramCreek
YouTube
Examples
Input: arr = ["un", "iq", "ue"]
Output: 4
Explanation: All possible concatenations are "", "un", "iq", "ue", "uniq" and "ique".
Maximum length is 4.
Input: arr = ["cha", "r", "act", "ers"]
Output: 6
Explanation: Possible solutions are "chaers" and "acters".
Input: arr = ["abcdefghijklmnopqrstuvwxyz"]
Output: 26
Solutions
Follow up
Last updated
Was this helpful?