The Island Counter
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L4
Problem
Given a 2D grid of '1' (land) and '0' (water) strings, return the number of distinct islands (connected groups of land cells using 4-directional adjacency).
Summary
Surrounded by water, connected by land - how many separate landmasses?
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.