You are given two grid1 and grid2 containing only
An island in grid2 is considered a sub island if every cell belonging to that island corresponds to a cell with value grid1.
Return the total number of islands in grid2 that are sub islands.
Constraints:
m grid1.length grid2.length
n grid1[i].length grid2[i].length
m, n
grid1[i][j] and grid2[i][j] are either
You are given two grid1 and grid2 containing only
An island in grid2 is considered a sub island if every cell belonging to that island corresponds to a cell with value grid1.
Return the total number of islands in grid2 that are sub islands.
Constraints:
m grid1.length grid2.length
n grid1[i].length grid2[i].length
m, n
grid1[i][j] and grid2[i][j] are either