ION Group interview question

GFG puzzle, Linked loop and how to remove it