1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-24 22:38:57 +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>m x n</code> 的矩阵 <code>mat</code> 和一个整数 <code>k</code> ,请你返回一个矩阵 <code>answer</code> ,其中每个 <code>answer[i][j]</code> 是所有满足下述条件的元素 <code>mat[r][c]</code> 的和: </p>\n\n<ul>\n\t<li><code>i - k <= r <= i + k, </code></li>\n\t<li><code>j - k <= c <= j + k</code> 且</li>\n\t<li><code>(r, c)</code> 在矩阵内。</li>\n</ul>\n\n<p> </p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>mat = [[1,2,3],[4,5,6],[7,8,9]], k = 1\n<strong>输出:</strong>[[12,21,16],[27,45,33],[24,39,28]]\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>mat = [[1,2,3],[4,5,6],[7,8,9]], k = 2\n<strong>输出:</strong>[[45,45,45],[45,45,45],[45,45,45]]\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>m == mat.length</code></li>\n\t<li><code>n == mat[i].length</code></li>\n\t<li><code>1 <= m, n, k <= 100</code></li>\n\t<li><code>1 <= mat[i][j] <= 100</code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 131,
"likes": 136,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -149,7 +149,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"16.9K\", \"totalSubmission\": \"22.4K\", \"totalAcceptedRaw\": 16893, \"totalSubmissionRaw\": 22402, \"acRate\": \"75.4%\"}",
"stats": "{\"totalAccepted\": \"17.8K\", \"totalSubmission\": \"23.5K\", \"totalAcceptedRaw\": 17763, \"totalSubmissionRaw\": 23534, \"acRate\": \"75.5%\"}",
"hints": [
"How to calculate the required sum for a cell (i,j) fast ?",
"Use the concept of cumulative sum array.",