
[LeetCode] 827. Making A Large Island (Python)
·
알고리즘/LeetCode
난이도: Hard문제 설명You are given an n x n binary matrix grid. You are allowed to change at most one 0 to be 1. Return the size of the largest island in grid after applying this operation. An island is a 4-directionally connected group of 1s. 문제 예제Example 1:Input: grid = [[1,0],[0,1]] Output: 3 Explanation: Change one 0 to 1 and connect two 1s, then we get an island with area = 3. Example 2:Input: gri..