Circular Linked List

my code is not getting accepted but i think the logic is correct it gives correct o/p in my local system but is not passing the test cases.
Please check the error.

You just keep taking inputs in the same manner as you did in the others(i.e. insertion at the tail) until you get an element which is already present in the list , in such case you need to check wheather the further elements are same if yess then point the last node to the matching node , else keep taking input .

Actually this question is for inputs having no dublicates . So no need for so much calculation . just store alll the elements and start traversing the list until u get the element which has already occurred before.
https://ide.codingblocks.com/#/s/17565

ok thank you i got it

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.