 All Problems
Construct Binary Tree from Inorder and Postorder
medium
trees
arrays
divide and conquer
hash map
amazon
google
microsoft
facebook

Given two integer arrays inorder and postorder representing the in-order and post-order traversals of a binary tree, construct and return the tree. Output level-order.

Example 1:

Input:
9 3 15 20 7
9 15 7 20 3
Output: 3 9 20 null null 15 7

Input format: Line 1: inorder. Line 2: postorder.

Output format: Level-order traversal.

Run to check your code against the sample cases, or submit to run every case