1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-07 08:21:41 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2023-12-09 19:57:46 +08:00
parent 9bc4722a45
commit 3770b44d1e
4792 changed files with 10889 additions and 10886 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>将一个给定字符串 <code>s</code> 根据给定的行数 <code>numRows</code> 以从上往下、从左到右进行 Z 字形排列。</p>\n\n<p>比如输入字符串为 <code>\"PAYPALISHIRING\"</code> 行数为 <code>3</code> 时,排列如下:</p>\n\n<pre>\nP A H N\nA P L S I I G\nY I R</pre>\n\n<p>之后,你的输出需要从左往右逐行读取,产生出一个新的字符串,比如:<code>\"PAHNAPLSIIGYIR\"</code>。</p>\n\n<p>请你实现这个将字符串进行指定行数变换的函数:</p>\n\n<pre>\nstring convert(string s, int numRows);</pre>\n\n<p> </p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"PAYPALISHIRING\", numRows = 3\n<strong>输出:</strong>\"PAHNAPLSIIGYIR\"\n</pre>\n<strong>示例 2</strong>\n\n<pre>\n<strong>输入:</strong>s = \"PAYPALISHIRING\", numRows = 4\n<strong>输出:</strong>\"PINALSIGYAHRPI\"\n<strong>解释:</strong>\nP I N\nA L S I G\nY A H R\nP I\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"A\", numRows = 1\n<strong>输出:</strong>\"A\"\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= s.length <= 1000</code></li>\n\t<li><code>s</code> 由英文字母(小写和大写)、<code>','</code> 和 <code>'.'</code> 组成</li>\n\t<li><code>1 <= numRows <= 1000</code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 2231,
"likes": 2232,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -143,7 +143,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"624.4K\", \"totalSubmission\": \"1.2M\", \"totalAcceptedRaw\": 624413, \"totalSubmissionRaw\": 1192273, \"acRate\": \"52.4%\"}",
"stats": "{\"totalAccepted\": \"624.5K\", \"totalSubmission\": \"1.2M\", \"totalAcceptedRaw\": 624517, \"totalSubmissionRaw\": 1192443, \"acRate\": \"52.4%\"}",
"hints": [],
"solution": {
"id": "39",