Question: Write in python 3 please Regions in Grid 1 & 2 Regions There are 2 regions in the second grid: { ( 0 , 0
Write in python please
Regions in Grid &
Regions
There are regions in the second grid: and
Regions in grid cover the first region of grid but not the second region. There is matching region.
Making a slight alteration to the above example:
There are no matching regions. From the first graph, the at position is not matched in the second
grid's larger region. The second grid position is not matched in grid
Function Description
Complete the function countMatches in the editor below.
countMatches has the following parameters:
string gridn: an array of bit strings representing the rows of image
string gridn: an array of bit strings representing the rows of image
Returns:
int: number of matching regions.
Constraints
lengths of gridi and gridi
grid cells contain only o or
Input Format For Custom Testing
Sample Case
Sample Input
Sample Output
Expianation
Regions in Grid &
Regions
The first grid forms regions. They are and
The second grid forms regions. They are and
So only one region matches.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
