Areas
Practice
3.2 (22 votes)
Algorithms
Depth first search
Graphs
Problem
71% Success 1804 Attempts 10 Points 2s Time Limit 256MB Memory 1024 KB Max Code

You are given a 2D grid. A '#' represents an obstacle and a '.' represents free space. You need to find the areas of the disconnected components. The cells (i+1, j), (i, j+1), (i-1, j), (i, j-1) are the adjacent to the cell (i, j).

There are multiple test cases in this problem.

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:10
8 votes
Tags:
AlgorithmsTreesData StructuresDepth First SearchLowest Common AncestorGraphs