AMD interview question

detect and remove a loop from a linked list