Test Cases Failing (linked list)

My code : https://ide.codingblocks.com/s/54824
Question : https://hack.codingblocks.com/contests/c/537/471
Test cases are not getting passed pls guide.

when you are building linked list then you are not making a loop, instead of it,you are just adding values at the tail.
It is given in question if a number comes which is already in list then you have to put head->next to the address of that value.
Because you are not making a loop so check_cycle function is always returning null.
Hit like if u get it

1 Like