An array nextIndices describes a linked list whose head is node 0; each value is the next node index or -1 for null. Return whether following next pointers enters a cycle.
Constraints
0 <= nextIndices.length <= 10000
Every entry is -1 or a valid index
Follow-up
How does Floyd's slow/fast method translate to real node pointers?