Cycle detection and removal

actually in this question we cant implement that floyds algorithm since the linked list givenn is not actually a cycle. so how to do this question now?

is that approach correct?

Hi sanchit
Yes u r right for flyod detection to implement we need a cycle in link list so this question is just to go through the cycle detection of u know that u can do it by any way of convinent