← Questions
Count identical islands in two grids
0
I was asked this
No reports yet. Sign in to say where you were asked it.
You get two binary grids of the same size. A region is a group of 1 cells joined up, down, left or right. Count the regions that are exactly the same set of cells in both grids. Find the regions of one grid with BFS or DFS and check each against the other, making sure a match can't extend into extra cells in the second grid.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
