What's wrong in the code?

My code is giving undesired output. Please give it a look

Hey @mayanktyagi

    head = append(n, k, head); updated

Also for case k > n it should be

       k=k%n; 

Do this all test cases will get passed.

Getting TLE in second test case

Check when k is equal to 0, if it is then don’t call your append function.

still getting same response

if(k==n || k==0)
    {
        return head;
    }
	if(k>n){
		k = k%n;
	}

All test case passing, do this in your append function

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.