Construct Binary Tree from Preorder and Inorder Traversal at TikTok

Medium68.3% acceptance

This problem has 62.5% frequency at TikTok.

Problem Description

Given two integer arrays `preorder` and `inorder` where `preorder` is the preorder traversal of a binary tree and `inorder` is the inorder traversal of the same tree, construct and return _the binary tree_.

Read full problem and hints

Topics

Also asked at 10 companies


More TikTok Questions

View all TikTok questions