Point of possible null

In the problem above,
It’s suggested to use to find cycle. But we might have == null.

Hi, according to this loop in the solution “while (fast != null && != null)” the loop would break will equal to null and this would mean that it is a non-cyclic linked list.

1 Like