return B;Don't decorate B with its type. Only write the type in a parameter list or when you are creating a new variable.
Syntax error. Operator && is only used on boolean values. Use a comma to separate parameters in a function call.
Type error. The parameters of merge are both lists. The head of a list is an integer.