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

HI PSSHARMA HOPE THIS CODE WILL HELP YOU

if it solve your doubt please mark this one as resolved and give you feedback