Node *changeStartNode(Node *head, int k)
{
// Write your code here
int n=1;
if(head == NULL || head->next == NULL){
return head;
}
Node *prev= NULL;
Node *temp= head;
while(temp->next!=NULL)
{
temp=temp->next;
n++;
}
Node *temp1= head;
for(int i=1;i<=n-k;i++)
{
prev=temp1;
temp1=temp1->next;
}
prev->next=temp1->next;
temp1->next=head;
head=prev->next;
return temp1;
}