The code is showing run error for one testcase.
Linked List K Append
Hello @Chirag-Jain-1414278322030453,
Your code is not dealing with the case when k=N=2*N=…
for these cases, k%N=0
I have corrected your code:
Hope, this would help.
give a like if you are satisfied.
Same logic in different style with correction.