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.
You may assume all node values in the tree are unique (so any value can be located in inorder unambiguously).
Input / output
preorder: int[], inorder: int[]TreeNode (JSON test fixture is a LeetCode-style level-order array, e.g. [3,9,20,null,null,15,7], with null for a missing child)preorder and inorder consist of unique valuesinorder also appears in preorder, and vice versaHow would this change if node values were not guaranteed unique? What extra information would you need?