LL k reverse output incorrect


output is not correct.after index 2 output are correct index 1 and 2 are lost

@Vivek-Pandey-2129725577345937 you forgot to update the head in the main 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.

@Vivek-Pandey-2129725577345937 update the head in main function.
head=reverse(head,k);

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.

rate your experience page is not found