Kth node from end(linkedList)


I am unable to figure out why I am getting a runtime errror

Hi @ashish_meher
Problem with your input function. Line No 35. to be precise. Use a while instead of if.
That is , Line no 35 should be like
while(data!=-1)

1 Like

Thanks and sorry. I was frustrated.

@ashish_meher
No problem. Glad I could be of help.