Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Let's use floodfill to iterate over the islands of the second grid
Let's note that if all the cells in an island in the second grid if they are represented by land in the first grid then they are connected hence making that island a sub-island