Search⌘ K
AI Features

DIY: Number of Islands

Explore how to implement an algorithm in Elixir to count the number of islands in a 2D grid of land and water. Understand the problem of identifying connected land areas and practice coding a function that handles grid traversal to solve real-world inspired coding interview questions.

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 ...