mediumBlind 75
Construct Binary Tree from Preorder and Inorder Traversal
Construct and return the binary tree from preorder and inorder traversals Example: preorder=[3,9,20,15,7], inorder=[9,3,15,20,7] => [3,9,20,null,null,15,7]
Preorder hands me each root. Inorder shows what sits left and right of it, so I recurse on both halves.

Meet Coco
Coco is an AI study partner, not a person. She listens while you explain your code, asks what a line does and never hands you the fix. Sign in free to type with Coco, up to a daily limit, and to talk with her for one hour. After that, talking comes with the $79 pack. Anyone can open the editor and run their code.
1Construct Binary Tree from Preorder and Inorder Traversalmedium