private static void solveSolution(int[][] transform, int[] board, int[] solution) {
    int length = transform.length;
    
    for (int row = length - 1; row >= 0; row--) {
      int index = -1;
      int sum = 0;
      for (int col = 0; col < length; col++) {
        // Search for the first non-zero element in this row (pivot), then solve for it.
        if (index == -1 && transform[row][col] != 0) {
          index = col;
        } else if (index != -1) {
          // We are after the pivot so start keeping track of the desired sum.
          sum += transform[row][col] * solution[col];
        }
      }
      if (index != -1) {
        // solution[index] must satisfy solution[index] + sum = board[index];
        solution[index] = (sum + board[index]) % 2;
      }
    }
  }