Linked list- k append

it is showing run error for 1 test cases out of 5. i cant figure out whats wrong’s in my code.
my code—>>>>

Hey @agarwalbhavya06 the problem is that you aren’t printing anything when k is 0 so after the if(k > 0) block
add an else block in which you’ll print the linked list.
Please ask if you have any further queries or something is not clear.

yeah got it right thanks @keshavgupta0103