Giving correct answer for all my assumed case but not on submission

#include
using namespace std;

class node{
public:
int data;
node* next;

    node(int key){
        data = key;
        next= NULL;
    }

};

void input(node*&head , int key){
if(head == NULL){
head = new node(key);
}
else{
node * emp = head;
while(emp -> next != NULL){
emp = emp ->next;
}
node * temp = new node(key);
emp->next = temp;
}
}

void print (node * head){
while(head!=NULL){
cout<<head ->data<<" ";
head = head->next;
}
}

node* reverse(nodehead)
{
// Initialize current, previous and
// next pointers
node
current = head;
node *prev = NULL, *next = NULL;

    while (current != NULL) { 
        // Store next 
        next = current->next; 

        // Reverse current node's pointer 
        current->next = prev; 

        // Move pointers one position ahead. 
        prev = current; 
        current = next; 
    } 
    head = prev; 
	return head;
}

bool check_palindrome(nodehead,int len){
node
first = head;
node* second = head->next;

int mid = len/2;
//now break the link
if(len%2==0){
	while(mid--){
		if(mid)
		{	
		first = first->next;

		second = second->next;}
	}
	first ->next = NULL;
}
else{
	while(mid--){
		if(mid)
			first = first->next;
		second = second->next;
	}
	first->next = NULL;
}
//now here you are ready with two linked list;
//just reverse the first linked list and compare with other
first = reverse(head);
while(first!=NULL){
	if(first->data != second ->data){
		return false;
	}
	first = first->next;
	second = second->next;
}
return true;

}

int main(){
int len;
cin>>len;
node*head=NULL;
for(int i=0;i<len;i++){
int key;
cin>>key;
input(head,key);
}
if(check_palindrome(head,len)){
cout<<“True”;

}
else{
	cout<<"False";
}

return 0;

}

hello @saurabh66
pls share ur code using cb ide (pls follow this for future doubt as well)

@saurabh66
write “true” in place “True”
and
write “false” in place of “False”
it will work

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.