the solution for the problem of LinkedListCycle