mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-24 22:38:57 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p><strong>「快乐前缀」</strong> 是在原字符串中既是 <strong>非空</strong> 前缀也是后缀(不包括原字符串自身)的字符串。</p>\n\n<p>给你一个字符串 <code>s</code>,请你返回它的 <strong>最长快乐前缀</strong>。如果不存在满足题意的前缀,则返回一个空字符串<meta charset=\"UTF-8\" /> <code>\"\"</code> 。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"level\"\n<strong>输出:</strong>\"l\"\n<strong>解释:</strong>不包括 s 自己,一共有 4 个前缀(\"l\", \"le\", \"lev\", \"leve\")和 4 个后缀(\"l\", \"el\", \"vel\", \"evel\")。最长的既是前缀也是后缀的字符串是 \"l\" 。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"ababab\"\n<strong>输出:</strong>\"abab\"\n<strong>解释:</strong>\"abab\" 是最长的既是前缀也是后缀的字符串。题目允许前后缀在原字符串中重叠。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= s.length <= 10<sup>5</sup></code></li>\n\t<li><code>s</code> 只含有小写英文字母</li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 82,
|
||||
"likes": 89,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -155,7 +155,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"9.8K\", \"totalSubmission\": \"23.3K\", \"totalAcceptedRaw\": 9785, \"totalSubmissionRaw\": 23252, \"acRate\": \"42.1%\"}",
|
||||
"stats": "{\"totalAccepted\": \"10.3K\", \"totalSubmission\": \"24.3K\", \"totalAcceptedRaw\": 10340, \"totalSubmissionRaw\": 24320, \"acRate\": \"42.5%\"}",
|
||||
"hints": [
|
||||
"Use Longest Prefix Suffix (KMP-table) or String Hashing."
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user