mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-06 07:51:41 +08:00
update
This commit is contained in:
@@ -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": 1630,
|
||||
"likes": 1657,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -137,7 +137,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"409.5K\", \"totalSubmission\": \"788.8K\", \"totalAcceptedRaw\": 409526, \"totalSubmissionRaw\": 788760, \"acRate\": \"51.9%\"}",
|
||||
"stats": "{\"totalAccepted\": \"424.1K\", \"totalSubmission\": \"816.6K\", \"totalAcceptedRaw\": 424087, \"totalSubmissionRaw\": 816636, \"acRate\": \"51.9%\"}",
|
||||
"hints": [],
|
||||
"solution": {
|
||||
"id": "39",
|
||||
|
Reference in New Issue
Block a user