Making A Large Island at Meta
Hard56.3% acceptance
This problem has 75.0% frequency at Meta.
Problem 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.
Read full problem and hintsTopics
Also asked at 16 companies
More Meta Questions
Kth Largest Element in an ArrayMediumTwo SumEasyMerge IntervalsMediumMerge Sorted ArrayEasyFind Peak ElementMedium
View all Meta questions