Linked List append cpp


what’s wrong?

@Kush_1312 hey use k=k%n rest your logic is looking correct.

why so? after making the change one test case is failing

@Kush_1312 still your one test case failing?

yes heres the change i made https://ide.codingblocks.com/s/201274

i got what was wrong

i had to return if the kth element from end == the starting elemnent but could plz tell me why did i use k%n??

@Kush_1312 hey kyunki agr k> n hua to hm use linked list ki length se adjust krrhe hai suppose,n=3 k=5 so k mod n will be 2 so append from second node.This is logic behind it.

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.