Optimal Algorithmic Approach
HashMap (simpler) or in-place interleaving (O(1) space).
Core Invariants & Edge Cases
- HashMap approach: map original → clone, then set next and random
- In-place approach: interleave clones between originals, set randoms, then detach
- In-place is O(1) space but tricky