1
// --------------------- Solution 1 ---------------------3
public int oddCells(int m, int n, int[][] indices) {4
int[][] matrix = new int[m][n];6
for (int i = 0; i < indices.length; i++) {7
int row = indices[i][0];8
int col = indices[i][1];10
for (int j = 0; j < n; j++) {13
for (int j = 0; j < m; j++) {19
for (int i = 0; i < m; i++) {20
for (int j = 0; j < n; j++) {21
if (matrix[i][j] % 2 != 0) {31
// --------------------- Solution 2 ---------------------33
public int oddCells(int m, int n, int[][] indices) {34
int[] row = new int[m];35
int[] col = new int[n];37
for (int i = 0; i < indices.length; i++) {45
counter += (i + j) % 2 == 0 ? 0 : 1;