Number of Islands
CodingPhone, OnsiteSoftware Engineer, Machine Learning EngineerReported May, 2026Medium Frequency
Company question banks are included with the Insider plan.
Given a 2D grid grid where '1' represents land and '0' represents water, count and return the number of islands.
An island is formed by connecting adjacent lands horizontally or vertically...