The method must take in 3 parameters: Matrix, region number, max number. The method should take max number and check if values in the matrix are greater than the max number. If so, the function checks if nearby elements are also greater than said max number. If the number of elements that fit this description are greater than or equal to the region number, they turn into 1, otherwise, it turns into 0.
The output should be a matrix full of 1's and 0's
Do not wrap around matrix edges. Corner neighbors are not sufficient for island continuity
Example:
Island size is 4, Max number is 6
1,2,3,1,2,2
5,4,9,6,2,2
6,6,9,2,2,7
7,2,2,2,7,8
3,2,7,6,8,8
2,2,1,1,1,2
Output:
0,0,0,0,0,0
0,0,1,1,0,0
1,1,1,0,0,1
1,0,0,0,1,1
0,0,1,1,1,1
0,0,0,0,0,0
Example:
Island size is 3, Max number is 5
5,1,1
6,7,7
1,1,1
Output:
1,0,0
1,1,1
0,0,0