mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-07 00:11:41 +08:00
移除零宽空格
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
"boundTopicId": 1284,
|
||||
"title": "Repeated String Match",
|
||||
"titleSlug": "repeated-string-match",
|
||||
"content": "<p>Given two strings <code>a</code> and <code>b</code>, return <em>the minimum number of times you should repeat string </em><code>a</code><em> so that string</em> <code>b</code> <em>is a substring of it</em>. If it is impossible for <code>b</code> to be a substring of <code>a</code> after repeating it, return <code>-1</code>.</p>\n\n<p><strong>Notice:</strong> string <code>"abc"</code> repeated 0 times is <code>""</code>, repeated 1 time is <code>"abc"</code> and repeated 2 times is <code>"abcabc"</code>.</p>\n\n<p> </p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> a = "abcd", b = "cdabcdab"\n<strong>Output:</strong> 3\n<strong>Explanation:</strong> We return 3 because by repeating a three times "ab<strong>cdabcdab</strong>cd", b is a substring of it.\n</pre>\n\n<p><strong class=\"example\">Example 2:</strong></p>\n\n<pre>\n<strong>Input:</strong> a = "a", b = "aa"\n<strong>Output:</strong> 2\n</pre>\n\n<p> </p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li><code>1 <= a.length, b.length <= 10<sup>4</sup></code></li>\n\t<li><code>a</code> and <code>b</code> consist of lowercase English letters.</li>\n</ul>\n",
|
||||
"content": "<p>Given two strings <code>a</code> and <code>b</code>, return <em>the minimum number of times you should repeat string </em><code>a</code><em> so that string</em> <code>b</code> <em>is a substring of it</em>. If it is impossible for <code>b</code> to be a substring of <code>a</code> after repeating it, return <code>-1</code>.</p>\n\n<p><strong>Notice:</strong> string <code>"abc"</code> repeated 0 times is <code>""</code>, repeated 1 time is <code>"abc"</code> and repeated 2 times is <code>"abcabc"</code>.</p>\n\n<p> </p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> a = "abcd", b = "cdabcdab"\n<strong>Output:</strong> 3\n<strong>Explanation:</strong> We return 3 because by repeating a three times "ab<strong>cdabcdab</strong>cd", b is a substring of it.\n</pre>\n\n<p><strong class=\"example\">Example 2:</strong></p>\n\n<pre>\n<strong>Input:</strong> a = "a", b = "aa"\n<strong>Output:</strong> 2\n</pre>\n\n<p> </p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li><code>1 <= a.length, b.length <= 10<sup>4</sup></code></li>\n\t<li><code>a</code> and <code>b</code> consist of lowercase English letters.</li>\n</ul>\n",
|
||||
"translatedTitle": "重复叠加字符串匹配",
|
||||
"translatedContent": "<p>给定两个字符串 <code>a</code> 和 <code>b</code>,寻找重复叠加字符串 <code>a</code> 的最小次数,使得字符串 <code>b</code> 成为叠加后的字符串 <code>a</code> 的子串,如果不存在则返回 <code>-1</code>。</p>\n\n<p><strong>注意:</strong>字符串 <code>"abc"</code> 重复叠加 0 次是 <code>""</code>,重复叠加 1 次是 <code>"abc"</code>,重复叠加 2 次是 <code>"abcabc"</code>。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre><strong>输入:</strong>a = "abcd", b = "cdabcdab"\n<strong>输出:</strong>3\n<strong>解释:</strong>a 重复叠加三遍后为 "ab<strong>cdabcdab</strong>cd", 此时 b 是其子串。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre><strong>输入:</strong>a = "a", b = "aa"\n<strong>输出:</strong>2\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre><strong>输入:</strong>a = "a", b = "a"\n<strong>输出:</strong>1\n</pre>\n\n<p><strong>示例 4:</strong></p>\n\n<pre><strong>输入:</strong>a = "abc", b = "wxyz"\n<strong>输出:</strong>-1\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= a.length <= 10<sup>4</sup></code></li>\n\t<li><code>1 <= b.length <= 10<sup>4</sup></code></li>\n\t<li><code>a</code> 和 <code>b</code> 由小写英文字母组成</li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
|
Reference in New Issue
Block a user