Codehs - 8.1.5 Manipulating 2d Arrays

public class ArrayManipulator public static int[][] doubleArray(int[][] nums) nums.length == 0) return new int[0][0];

public static void doubleArrayInPlace(int[][] nums) if (nums == null) return; for (int row = 0; row < nums.length; row++) for (int col = 0; col < nums[row].length; col++) nums[row][col] *= 2;

For an N x N matrix, the element at (r, c) moves to (c, N - 1 - r) . Codehs 8.1.5 Manipulating 2d Arrays

Her mind raced through the CodeHS lessons: Manipulating 2D arrays means thinking in two dimensions at once.

To touch every element in a 2D array, you must use nested loops. The controls the row. The inner loop controls the column. The controls the row

For example:

matrix[0].length returns the total number of columns in the first row. Summing all values in a specific row, column,

Summing all values in a specific row, column, or the entire grid.

The goal is to test your ability to navigate nested loops and access elements using array[row][col] syntax.