LINKED LIST-K APPEND time limit exceeded
Hi Eshita, you are not taking the input as specified in input format in question. You are terminating the process of input after you get a -1, but since -1 is never given it becomes an infinte loop.
Also there is a bug in your code which you have noticed. You will be able to figure that out once you read the question statement completely and carefully. View question here
Hope this helps 