Halloween Sale
Unlock all premium questions for over 30% off
Remove a Forest Subtree
Medium
Question
One integer array, parentIndex, is all you get to describe a forest. Nodes have no names other than their positions, and the value at position i tells you which node sits directly above node i. Roots store their own position.
...
Asked at:Pinterest
More Pinterest interview questions
- Scooter Street Ride Simulationeasy
- Distribute Ads Across Columnseasy
- Find Unallocated Bucket ID Rangesmedium
- Single Bubble Explosionmedium
- Game Level Trackermedium
- Maximum Meeting Schedulemedium
- Playlist Song Connectionmedium
- Article Ranking Systemmedium
OfferRetriever
Master technical interviews with real questions from top companies. Build your confidence and career.
LEGAL
© 2026 Purple Business Holdings LLC. All rights reserved. See Terms of Service.