Problem
You are given a list of strings arr. Choose any subsequence of them (keep or drop each string, keeping their order) and glue the chosen ones together. The glued string must have all unique characters. Return the maximum possible length of such a string. Choosing nothing gives length 0.
Example 1
- Input
- ["un", "iq", "ue"]
- Output
- 4
- Why
- "uniq" or "ique"
Example 2
- Input
- ["cha", "r", "act", "ers"]
- Output
- 6
- Why
- "chaers" or "acters"
Example 3
- Input
- ["aa", "bb"]
- Output
- 0
- Why
- each string repeats a letter
Constraints
1 <= arr.length <= 161 <= arr[i].length <= 26arr[i] contains only lowercase English letters.