Search⌘ K

DIY: Number of Islands

Explore how to solve the classic 'Number of Islands' problem by implementing a JavaScript function that counts islands in a 2D grid. Understand how to navigate and analyze grid data to identify connected land regions, preparing you for real interview scenarios.

We'll cover the following...

Problem statement

Given an m x n 2D grid map of 1's (land) and 0's (water), return the number of islands.

An island is surrounded by water and is ...