mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 03:33:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			48 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			48 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<p>给定一个字符串数组 <code>arr</code>,字符串 <code>s</code> 是将 <code>arr</code> 的含有 <strong>不同字母</strong> 的 <strong>子序列</strong> 字符串 <strong>连接</strong> 所得的字符串。</p>
 | 
						||
 | 
						||
<p>请返回所有可行解 <code>s</code> 中最长长度。</p>
 | 
						||
 | 
						||
<p><strong>子序列</strong> 是一种可以从另一个数组派生而来的数组,通过删除某些元素或不删除元素而不改变其余元素的顺序。</p>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>示例 1:</strong></p>
 | 
						||
 | 
						||
<pre>
 | 
						||
<strong>输入:</strong>arr = ["un","iq","ue"]
 | 
						||
<strong>输出:</strong>4
 | 
						||
<strong>解释:</strong>所有可能的串联组合是:
 | 
						||
- ""
 | 
						||
- "un"
 | 
						||
- "iq"
 | 
						||
- "ue"
 | 
						||
- "uniq" ("un" + "iq")
 | 
						||
- "ique" ("iq" + "ue")
 | 
						||
最大长度为 4。
 | 
						||
</pre>
 | 
						||
 | 
						||
<p><strong>示例 2:</strong></p>
 | 
						||
 | 
						||
<pre>
 | 
						||
<strong>输入:</strong>arr = ["cha","r","act","ers"]
 | 
						||
<strong>输出:</strong>6
 | 
						||
<strong>解释:</strong>可能的解答有 "chaers" 和 "acters"。
 | 
						||
</pre>
 | 
						||
 | 
						||
<p><strong>示例 3:</strong></p>
 | 
						||
 | 
						||
<pre>
 | 
						||
<strong>输入:</strong>arr = ["abcdefghijklmnopqrstuvwxyz"]
 | 
						||
<strong>输出:</strong>26
 | 
						||
</pre>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>提示:</strong></p>
 | 
						||
 | 
						||
<ul>
 | 
						||
	<li><code>1 <= arr.length <= 16</code></li>
 | 
						||
	<li><code>1 <= arr[i].length <= 26</code></li>
 | 
						||
	<li><code>arr[i]</code> 中只含有小写英文字母</li>
 | 
						||
</ul>
 |