mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 11:43:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			36 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<p>给定字符串列表 <code>strs</code> ,返回 <em>它们中 <strong>最长的特殊序列</strong></em> 。如果最长特殊序列不存在,返回 <code>-1</code> 。</p>
 | 
						||
 | 
						||
<p><strong>最长特殊序列</strong> 定义如下:该序列为某字符串 <strong>独有的最长子序列(即不能是其他字符串的子序列)</strong>。</p>
 | 
						||
 | 
						||
<p> <code>s</code> 的 <strong>子序列</strong>可以通过删去字符串 <code>s</code> 中的某些字符实现。</p>
 | 
						||
 | 
						||
<ul>
 | 
						||
	<li>例如,<code>"abc"</code> 是 <code>"aebdc"</code> 的子序列,因为您可以删除<code>"a<u>e</u>b<u>d</u>c"</code>中的下划线字符来得到 <code>"abc"</code> 。<code>"aebdc"</code>的子序列还包括<code>"aebdc"</code>、 <code>"aeb"</code> 和 <font color="#c7254e" face="Menlo, Monaco, Consolas, Courier New, monospace"><span style="font-size: 12.6px; background-color: rgb(249, 242, 244);">""</span></font> (空字符串)。</li>
 | 
						||
</ul>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>示例 1:</strong></p>
 | 
						||
 | 
						||
<pre>
 | 
						||
<strong>输入:</strong> strs = ["aba","cdc","eae"]
 | 
						||
<strong>输出:</strong> 3
 | 
						||
</pre>
 | 
						||
 | 
						||
<p><strong>示例 2:</strong></p>
 | 
						||
 | 
						||
<pre>
 | 
						||
<strong>输入:</strong> strs = ["aaa","aaa","aa"]
 | 
						||
<strong>输出:</strong> -1
 | 
						||
</pre>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>提示:</strong></p>
 | 
						||
 | 
						||
<ul>
 | 
						||
	<li><code>2 <= strs.length <= 50</code></li>
 | 
						||
	<li><code>1 <= strs[i].length <= 10</code></li>
 | 
						||
	<li><code>strs[i]</code> 只包含小写英文字母</li>
 | 
						||
</ul>
 |