mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-08 00:41:42 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个正方形矩阵 <code>mat</code>,请你返回矩阵对角线元素的和。</p>\n\n<p>请你返回在矩阵主对角线上的元素和副对角线上且不在主对角线上元素的和。</p>\n\n<p> </p>\n\n<p><strong>示例 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 [4,<strong>5</strong>,6],\n [<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>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>mat = [[<strong>1</strong>,1,1,<strong>1</strong>],\n [1,<strong>1</strong>,<strong>1</strong>,1],\n [1,<strong>1</strong>,<strong>1</strong>,1],\n [<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> </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 <= n <= 100</code></li>\n\t<li><code>1 <= mat[i][j] <= 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."
|
||||
],
|
||||
|
Reference in New Issue
Block a user