Linked List-K Append

my code is giving tle in some cases? https://ide.codingblocks.com/s/309866