You are given two integer arrays preorder and inorder where: Return the postorder traversal (left → right → root) of the tree. Example:Input:preorder = [1,2,4,5,3,6]inorder = [4,2,5,1,3,6]Output:[4,5,2,6,3,1] This problem revolves around reconstructing the traversal logic of a binary tree using two known traversal orders. The key insight is that preorder gives you the root first,…