Loading...
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
- mid, senior
Problem
A geospatial analysis tool needs to count discrete connected regions in a binary grid. Given a 2D grid of strings where '1' represents land and '0' represents water, return the number of islands. An island is formed by connecting adjacent land cells horizontally or vertically.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.