mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 11:43:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			32 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<p>给定一个包含大写字母和小写字母的字符串<meta charset="UTF-8" /> <code>s</code> ,返回 <em>通过这些字母构造成的 <strong>最长的 <span data-keyword="palindrome-string">回文串</span></strong></em> 的长度。</p>
 | 
						|
 | 
						|
<p>在构造过程中,请注意 <strong>区分大小写</strong> 。比如 <code>"Aa"</code> 不能当做一个回文字符串。</p>
 | 
						|
 | 
						|
<p> </p>
 | 
						|
 | 
						|
<p><strong class="example">示例 1: </strong></p>
 | 
						|
 | 
						|
<pre>
 | 
						|
<strong>输入:</strong>s = "abccccdd"
 | 
						|
<strong>输出:</strong>7
 | 
						|
<strong>解释:</strong>
 | 
						|
我们可以构造的最长的回文串是"dccaccd", 它的长度是 7。
 | 
						|
</pre>
 | 
						|
 | 
						|
<p><strong class="example">示例 2:</strong></p>
 | 
						|
 | 
						|
<pre>
 | 
						|
<strong>输入:</strong>s = "a"
 | 
						|
<strong>输出:</strong>1
 | 
						|
<strong>解释:</strong>可以构造的最长回文串是"a",它的长度是 1。
 | 
						|
</pre>
 | 
						|
 | 
						|
<p> </p>
 | 
						|
 | 
						|
<p><strong>提示:</strong></p>
 | 
						|
 | 
						|
<ul>
 | 
						|
	<li><code>1 <= s.length <= 2000</code></li>
 | 
						|
	<li><code>s</code> 只由小写 <strong>和/或</strong> 大写英文字母组成</li>
 | 
						|
</ul>
 |