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 hints

Topics

Also asked at 16 companies


More TikTok Questions

View all TikTok questions