Graph Theory37 sections · 1633 units
Open in Course

LeetCode 827 Making A Large Island - Problem Statement

LeetCode 827

Problem: Making A Large Island Task: You have a grid of 00s and 11s. You can flip one 00 to 11. Find the maximum island size achievable. Use DSU to track island components.

For each 00, check its neighbors. If flipping this 00 connects distinct islands, sum their sizes plus one. Track the maximum. Be careful not to double-count: if two neighbors belong to the same island, count that island's size only once. Use the component leader to detect duplicates.