1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-13 11:21:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

add leetcode problem-cn part3

This commit is contained in:
2022-03-27 20:46:41 +08:00
parent 6dafca13c5
commit dfacb20d31
1385 changed files with 115239 additions and 3 deletions

View File

@@ -0,0 +1,36 @@
<p>在给定的二维二进制数组 <code>A</code> 中,存在两座岛。(岛是由四面相连的 <code>1</code> 形成的一个最大组。)</p>
<p>现在,我们可以将 <code>0</code> 变为 <code>1</code>,以使两座岛连接起来,变成一座岛。</p>
<p>返回必须翻转的 <code>0</code> 的最小数目。(可以保证答案至少是 <code>1</code> 。)</p>
<p> </p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>A = [[0,1],[1,0]]
<strong>输出:</strong>1
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>A = [[0,1,0],[0,0,0],[0,0,1]]
<strong>输出:</strong>2
</pre>
<p><strong>示例 3</strong></p>
<pre>
<strong>输入:</strong>A = [[1,1,1,1,1],[1,0,0,0,1],[1,0,1,0,1],[1,0,0,0,1],[1,1,1,1,1]]
<strong>输出:</strong>1</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>2 <= A.length == A[0].length <= 100</code></li>
<li><code>A[i][j] == 0</code><code>A[i][j] == 1</code></li>
</ul>