mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-02 22:13:28 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>当一个字符串 <code>s</code> 包含的每一种字母的大写和小写形式 <strong>同时</strong> 出现在 <code>s</code> 中,就称这个字符串 <code>s</code> 是 <strong>美好</strong> 字符串。比方说,<code>\"abABB\"</code> 是美好字符串,因为 <code>'A'</code> 和 <code>'a'</code> 同时出现了,且 <code>'B'</code> 和 <code>'b'</code> 也同时出现了。然而,<code>\"abA\"</code> 不是美好字符串因为 <code>'b'</code> 出现了,而 <code>'B'</code> 没有出现。</p>\n\n<p>给你一个字符串 <code>s</code> ,请你返回 <code>s</code> 最长的 <strong>美好子字符串</strong> 。如果有多个答案,请你返回 <strong>最早</strong> 出现的一个。如果不存在美好子字符串,请你返回一个空字符串。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<b>输入:</b>s = \"YazaAay\"\n<b>输出:</b>\"aAa\"\n<strong>解释:</strong>\"aAa\" 是一个美好字符串,因为这个子串中仅含一种字母,其小写形式 'a' 和大写形式 'A' 也同时出现了。\n\"aAa\" 是最长的美好子字符串。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<b>输入:</b>s = \"Bb\"\n<b>输出:</b>\"Bb\"\n<b>解释:</b>\"Bb\" 是美好字符串,因为 'B' 和 'b' 都出现了。整个字符串也是原字符串的子字符串。</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<b>输入:</b>s = \"c\"\n<b>输出:</b>\"\"\n<b>解释:</b>没有美好子字符串。</pre>\n\n<p><strong>示例 4:</strong></p>\n\n<pre>\n<b>输入:</b>s = \"dDzeE\"\n<b>输出:</b>\"dD\"\n<strong>解释:</strong>\"dD\" 和 \"eE\" 都是最长美好子字符串。\n由于有多个美好子字符串,返回 \"dD\" ,因为它出现得最早。</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= s.length <= 100</code></li>\n\t<li><code>s</code> 只包含大写和小写英文字母。</li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 161,
|
||||
"likes": 162,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -155,7 +155,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"24.1K\", \"totalSubmission\": \"34.8K\", \"totalAcceptedRaw\": 24124, \"totalSubmissionRaw\": 34801, \"acRate\": \"69.3%\"}",
|
||||
"stats": "{\"totalAccepted\": \"24.5K\", \"totalSubmission\": \"35.4K\", \"totalAcceptedRaw\": 24472, \"totalSubmissionRaw\": 35414, \"acRate\": \"69.1%\"}",
|
||||
"hints": [
|
||||
"Brute force and check each substring to see if it is nice."
|
||||
],
|
||||
|
Reference in New Issue
Block a user