Arrays — Codehs 8.1.5 Manipulating 2d

return matrix;

that value based on a given set of rules (e.g., changing all 0s to 1s, or flipping colors in a grid). Key Concepts for Manipulation Codehs 8.1.5 Manipulating 2d Arrays

// Manipulation task 8.1.5 specific: Create diagonal pattern public static void diagonalOne(int[][] arr) for (int r = 0; r < arr.length; r++) for (int c = 0; c < arr[0].length; c++) if (r == c) arr[r][c] = 1; else if (r + c == arr.length - 1) arr[r][c] = 1; // Anti-diagonal also to 1 else arr[r][c] = 0; return matrix; that value based on a given set of rules (e

Let me know which part of the or syntax is giving you trouble! changing all 0s to 1s