← 返回 meta 的题目列表Maximum Area of Island After One Flip
类型:online_judge
Given a 2D grid of 0s and 1s where 1 represents land and 0 represents water, flip at most one 0 to a 1. Find the maximum area of an island that can be formed. An island is a connected group of 1s formed by horizontal and vertical connections only.
Example:
Input: [ [1, 0], [0, 1], [1, 1] ] Output: 5
Example
Input
3 2
1 0
0 1
1 1