Reconstruct a tree from two traversals | TikTok Interview Question