Not working ! i think there will be a erron in removal function

@dishant_rahangdale, there are some errors in your code :-

  1. you are not taking input correctly, the build function for this question is different , build function must be already provided in the prefilled code snippet

  2. you have to return when you remove the loop as it will again start executing the loop which will be waste of time

  3. while loop condition in your innermost while loop is wrong, it should be
    while(fast->next!=temp->next)

     node* removal(node*head){
     node*answer = head;
     node*slow = head;
     node*fast = head;
     while(fast!=NULL and fast->next!=NULL){
     	fast = fast->next->next;
     	slow = slow->next;
     	if(slow==fast){
     		node*temp = head;
     		while(fast->next!=temp->next){
     			fast=fast->next;
     			temp=temp->next;
     		}
     		fast->next=NULL;
                     return answer;
     	}
     }
     return answer;
    

    }

correct code :-

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.