Help with error

https://hack.codingblocks.com/app/contests/2022/293/problem

answer is correct but not being accepted

hello @raghav007

u r not builing circular list. ur code will always create linear list.

submit ur code here.
https://hack.codingblocks.com/app/contests/2031/1307/problem

build function is already given , u only have to code cycle detection and removal part

but I created a function for making circular linked list is it wrong?

yes… . . . . . . . . .

if I simply iterate the linked list and whenever I find a repeating value I point the node before that to NULL , will it work kartik sir said that there is no need for a linked list. Some other ta told me to make it the way I did before

if u want to learn the algorithm then try to build the circular list first and then use floyd algo .

if u only want to get right answer then do what other ta suggested

I’m getting a segmentation fault, right now I want to do this way for now.

check now->

thanks a lot the way to make the cycle here is to find the first repeating node and make the node behind it(the tail) to point to the first occurrence of that node right?

yes…



. . . .

awesome I guess the other ta made a mistake

see this code(buildlist) for clarity->
https://hack.codingblocks.com/app/contests/2031/1307/problem

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.