Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a code in java to recursively count how many ? marks are grouped. A group is when ? is touching left, right, up, and

Write a code in java to recursively count how many "?" marks are grouped.
A group is when "?" is touching left, right, up, and down. NOT diagonally. A comma is used to represent a blank space in the matrix.
The first parameter will be a string containing all of the values in the grid. The values in the string must be converted into a String[][] matrix. The second parameter will contain a String that contains all of the coordinate pairs to check.
Print out the number of ? marks are grouped at each of the coordinate pairs.
Example:
, , , , , , , , , ,
, , , ???????
???, , , , ??,
?, , , , , , ???
, , , , , ????,
???, , , , , , ,
???????, , ,
???, , , , , ??
, , , , , , , , , ,
, , , , , ????,
1 1 2 7 2 0 6 6
output:
0
16
4
13
code given:
int start(int a, int b) {
//code goes here
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions

Question

=+2 Why did OBI create Centers of Excellence?

Answered: 1 week ago

Question

=+professionalism and competency in handling global HR issues?

Answered: 1 week ago