My reverse function showing segmentation fault

can you please check my code

@aryaman.kumar26 k cannot be negative dont worry about that case

so i won’t be able to score full 100?

@aryaman.kumar26 there are no cases where k < 0 how does it affect your score?

@aryaman.kumar26
For k=n print linked list as it is and for k>n do k=k%n;
It was not mentioned in the question but it is according to the test cases.

then why still some test cases are not running

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.