Linked Lists
63 / 170Linked ListsLesson 8 of 12About 48 min
If a value can be read as an index, an array becomes a list, and cycle detection applies to it.
It has no linked list in it. It is here because the technique is the one from three lessons ago, and the entire difficulty is noticing that the array can be read as one.
That noticing is the skill worth having. When a problem forbids modifying the input and forbids extra space, and involves values that happen to be valid indexes, this reframe is what is being asked for.
In an array of length n whose values are all valid indexes, why is the walk guaranteed to cycle?
Read the constraints first and let them tell you what complexity is expected. Derive the approach, implement it, run the tests, and submit when it passes.