← Questions

Number of islands: count connected land in a grid

0
AmazonAppleGoogle+2CodingLast asked Sep 2026

Given a grid of 0s and 1s, count the islands. An island is a group of 1 cells joined through shared edges (up, down, left, right); diagonal contact doesn't join them.

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 3 credits: each one unlocks a question for good.

Your code and the AI tutor open when you unlock this question.