1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-08 00:41:42 +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>mat</code>,请你返回矩阵对角线元素的和。</p>\n\n<p>请你返回在矩阵主对角线上的元素和副对角线上且不在主对角线上元素的和。</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例&nbsp; 1</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode.com/uploads/2020/08/14/sample_1911.png\" style=\"height:174px; width:336px\" /></p>\n\n<pre>\n<strong>输入:</strong>mat = [[<strong>1</strong>,2,<strong>3</strong>],\n&nbsp; [4,<strong>5</strong>,6],\n&nbsp; [<strong>7</strong>,8,<strong>9</strong>]]\n<strong>输出:</strong>25\n<strong>解释:</strong>对角线的和为1 + 5 + 9 + 3 + 7 = 25\n请注意元素 mat[1][1] = 5 只会被计算一次。\n</pre>\n\n<p><strong>示例&nbsp; 2</strong></p>\n\n<pre>\n<strong>输入:</strong>mat = [[<strong>1</strong>,1,1,<strong>1</strong>],\n&nbsp; [1,<strong>1</strong>,<strong>1</strong>,1],\n&nbsp; [1,<strong>1</strong>,<strong>1</strong>,1],\n&nbsp; [<strong>1</strong>,1,1,<strong>1</strong>]]\n<strong>输出:</strong>8\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre>\n<strong>输入:</strong>mat = [[<strong>5</strong>]]\n<strong>输出:</strong>5\n</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>n == mat.length == mat[i].length</code></li>\n\t<li><code>1 &lt;= n &lt;= 100</code></li>\n\t<li><code>1 &lt;= mat[i][j] &lt;= 100</code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 45,
"likes": 50,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -143,7 +143,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"24.3K\", \"totalSubmission\": \"30.2K\", \"totalAcceptedRaw\": 24265, \"totalSubmissionRaw\": 30188, \"acRate\": \"80.4%\"}",
"stats": "{\"totalAccepted\": \"25.7K\", \"totalSubmission\": \"32K\", \"totalAcceptedRaw\": 25740, \"totalSubmissionRaw\": 31974, \"acRate\": \"80.5%\"}",
"hints": [
"There will be overlap of elements in the primary and secondary diagonals if and only if the length of the matrix is odd, which is at the center."
],