Search⌘ K
AI Features

Solution: Making A Large Island

Let's solve the Making A Large Island problem using the Graphs pattern.

Statement

Given an n x n binary matrix grid, you are permitted to flip at most one cell from 00 to 11. After performing this operation, return the size of the largest island in grid.

An island is defined as a group of 11s that are connected in 44 ...