DIY: Number of Islands
Explore how to solve the classic Number of Islands problem by counting connected lands in a 2D grid. Understand how to implement an efficient C++ function to identify islands formed by horizontally or vertically adjacent lands. This lesson prepares you to handle similar graph traversal problems in coding interviews.
We'll cover the following...
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 ...