Question: JAVA Problem: code to traverse a matrix to count how many dollar signs ( $ ) are grouped. A group consists of all dollar signs
JAVA
Problem: code to traverse a matrix to count how many dollar signs ( $ ) are grouped. A group consists of all dollar signs touching up, down, left, and right. Dollar signs are not grouped diagonally. A period ( . ) will be used to represent blank spaces in the matrix. The top left corner of the matrix is 0,0.
Input: 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. Output: Print out the number of dollar signs grouped at each of the coordinate pairs.
Sample Input: .......... ...$$$$$$$ $$$....$$. $......$$$ .....$$$$. $$$....... $$$$$$$... $$$.....$$ .......... .....$$$$. 1 1 2 7 2 0 6 6 Output Input: 0 16 4 13
******Please use this format****
int go( int a, int b { // your code goes here }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
