Kth Element From The End In Linked List

One test case shows runtime error. What is the error?

hello @Anaghajain
1 2 3 4 5 6 -1
6
run ur code for above example.

Thank You! Found my mistake!