Familiar Ground
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant feedback.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L3
Problem
A linked list is stored compactly as an array where `next_pointers[i]` holds the index of node `i`'s successor, or `-1` when node `i` is the tail. Starting at index 0 and following these pointers, return whether the walk ever returns to a node it already visited instead of terminating. A pointer that lands outside the array counts as a terminating tail, the same as `-1`.
Summary
Keep walking. Sooner or later you may recognize where you're standing.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and checks it automatically.