mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-22 05:26:46 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个由若干 <code>0</code> 和 <code>1</code> 组成的二维网格 <code>grid</code>,请你找出边界全部由 <code>1</code> 组成的最大 <strong>正方形</strong> 子网格,并返回该子网格中的元素数量。如果不存在,则返回 <code>0</code>。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre><strong>输入:</strong>grid = [[1,1,1],[1,0,1],[1,1,1]]\n<strong>输出:</strong>9\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre><strong>输入:</strong>grid = [[1,1,0,0]]\n<strong>输出:</strong>1\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= grid.length <= 100</code></li>\n\t<li><code>1 <= grid[0].length <= 100</code></li>\n\t<li><code>grid[i][j]</code> 为 <code>0</code> 或 <code>1</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 88,
|
||||
"likes": 90,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -149,7 +149,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"10.6K\", \"totalSubmission\": \"21.8K\", \"totalAcceptedRaw\": 10589, \"totalSubmissionRaw\": 21762, \"acRate\": \"48.7%\"}",
|
||||
"stats": "{\"totalAccepted\": \"10.8K\", \"totalSubmission\": \"22.2K\", \"totalAcceptedRaw\": 10791, \"totalSubmissionRaw\": 22214, \"acRate\": \"48.6%\"}",
|
||||
"hints": [
|
||||
"For each square, know how many ones are up, left, down, and right of this square. You can find it in O(N^2) using dynamic programming.",
|
||||
"Now for each square ( O(N^3) ), we can evaluate whether that square is 1-bordered in O(1)."
|
||||
|
Reference in New Issue
Block a user