Run error in Kth element from last in Linked list

I think my code is correct but all three test cases showing run error.

@vivek21,
Your code is absolutely correct and should give you correct answer. Did you select the correct language while submitting? If the problem persists, kindly log out then log in again and try to submit. Your code is correct.