Making A Large Island at TikTok
Hard56.3% acceptance
This problem has 75.0% frequency at TikTok.
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 TikTok Questions
Number of IslandsMediumTrapping Rain WaterHardMerge IntervalsMediumCourse ScheduleMediumCourse Schedule IIMedium
View all TikTok questions