← 返回 meta 的题目列表Flip One 0 to Maximize Island Area
类型:online_judge
You are given an n x n binary matrix grid. You may change at most one 0 to 1. Return the maximum possible island area after the change.
An island is a group of 1s connected 4-directionally.
Example:
Input: [[1,0],[0,1]]
Output: 3
Constraints:
1 <= n <= 500
Example
Input
grid=[[1,0],[0,1]]
Output
3