1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-22 13:36:46 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>给你一个字符串数组 <code>words</code> ,找出并返回数组中的 <strong>第一个回文字符串</strong> 。如果不存在满足要求的字符串,返回一个 <strong>空字符串</strong><em> </em><code>\"\"</code> 。</p>\n\n<p><strong>回文字符串</strong> 的定义为:如果一个字符串正着读和反着读一样,那么该字符串就是一个 <strong>回文字符串</strong> 。</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<pre><strong>输入:</strong>words = [\"abc\",\"car\",\"ada\",\"racecar\",\"cool\"]\n<strong>输出:</strong>\"ada\"\n<strong>解释:</strong>第一个回文字符串是 \"ada\" 。\n注意\"racecar\" 也是回文字符串,但它不是第一个。\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre><strong>输入:</strong>words = [\"notapalindrome\",\"racecar\"]\n<strong>输出:</strong>\"racecar\"\n<strong>解释:</strong>第一个也是唯一一个回文字符串是 \"racecar\" 。\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre><strong>输入:</strong>words = [\"def\",\"ghi\"]\n<strong>输出:</strong>\"\"\n<strong>解释:</strong>不存在回文字符串,所以返回一个空字符串。\n</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= words.length &lt;= 100</code></li>\n\t<li><code>1 &lt;= words[i].length &lt;= 100</code></li>\n\t<li><code>words[i]</code> 仅由小写英文字母组成</li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 6,
"likes": 7,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -149,7 +149,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"8.4K\", \"totalSubmission\": \"10.6K\", \"totalAcceptedRaw\": 8421, \"totalSubmissionRaw\": 10590, \"acRate\": \"79.5%\"}",
"stats": "{\"totalAccepted\": \"8.9K\", \"totalSubmission\": \"11.3K\", \"totalAcceptedRaw\": 8925, \"totalSubmissionRaw\": 11256, \"acRate\": \"79.3%\"}",
"hints": [
"Iterate through the elements in order. As soon as the current element is a palindrome, return it.",
"To check if an element is a palindrome, can you reverse the string?"