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
Get step-by-step solutions from verified subject matter experts
