Question: convert nested for loop into nested while loop please: int[][] sol = new int[rows + 2][columns + 2]; for (i = 1 ; i

convert nested for loop into nested while loop please:

int[][] sol = new int[rows + 2][columns + 2]; for (i = 1 ; i <= rows ; i++) { for (j = 1 ; j <= columns ; j++) { // (ii, jj) indexes neighboring cells for (int ii = i - 1 ; ii <= i + 1 ; ii++) { for (int jj = j - 1 ; jj <= j + 1 ; jj++) { if (bombCells[ii][jj]) { sol[i][j]++; } } } } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!