同步操作将从 doocs/leetcode 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Imagine you have a square matrix, where each cell (pixel) is either black or white Design an algorithm to find the maximum subsquare such that all four borders are filled with black pixels.
Return an array [r, c, size]
, where r
, c
are the row number and the column number of the subsquare's upper left corner respectively, and size
is the side length of the subsquare. If there are more than one answers, return the one that has smallest r
. If there are more than one answers that have the same r
, return the one that has smallest c
. If there's no answer, return an empty array.
Example 1:
Input: [ [1,0,1], [0,0,1], [0,0,1] ] Output: [1,0,2] Explanation: 0 represents black, and 1 represents white, bold elements in the input is the answer.
Example 2:
Input: [ [0,1,1], [1,0,1], [1,1,0] ] Output: [0,0,1]
Note:
matrix.length == matrix[0].length <= 200
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。