Largest Island After One Flip
Asked at Uber · Coding Questions · Difficulty: Hard · Last asked Jan 7, 2026
You are given a square grid of `0`s (water) and `1`s (land). You may turn at most one `0` into `1`. After that change, find the size of the largest island, where an island is a group of `1`s connected through their four neighbours (up, down, left, right).
Loading the problem…