0827. Making A Large Island
https://leetcode.com/problems/making-a-large-island
Description
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 1
s.
Example 1:
Example 2:
Example 3:
Constraints:
n == grid.length
n == grid[i].length
1 <= n <= 500
grid[i][j]
is either0
or1
.
ac
Previous0826. Most Profit Assigning WorkNext0828. Count Unique Characters of All Substrings of a Given String
Last updated