(NOTE I DONT WANT ANSWER TO THIS QUESTION I WANT TO KNOW WHATS WRONG IN MY CODE PLEASE TELL ME)I was trying to do CircularLInkedList question. but im getting one test case wrong

The idea used here is that first I will store last element of LL in a variable lastE and i will traverse the linked list from start until i get lastE = currelement. After getting a equal element. we will traverse in reverse until lastE != currelement and side by side we will be removing the last element of LL. the code is below please tell me whats wrong. code : https://ide.codingblocks.com/s/587286

Sir please tell my doubt