Linked List - K Append(2 test case show WA)

Here’s link to my code


Two test cases are failing. Which edge condition am I forgetting?

@isa67719 Consider when k>number of elements in linked list… You have to do k=k%n and then proceed with the problem.
So if Input is:
7
1 2 2 1 8 5 6
8

Output should be:
6 1 2 2 1 8 5

Do some modifications in your code according to this case and then check.

Hope this helps :slightly_smiling_face: