Tuesday common C++ interview problem: Construct a binary tree from preorder and inorder traversals.
Given the preorder and inorder traversals (both as std::span<int>), construct the corresponding binary tree.
Use the add_node(int) method on the provided tree object and return the root node.
Solve it yourself: https://compiler-explorer.com/z/Y4WoE3ETY
Solution: https://compiler-explorer.com/z/zdcfjssfs