Construct binary tree from preorder and inorder -Leetcode problem

it is running perfectly but when i am submitting it shows error.

ide->https://ide.codingblocks.com/s/223390

ques->https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/

hi @mikkyimran I cannot currently figure out why runtime error is arising for that input but meanwhile you can see my approach for a slightly different but similar question (construct BST from preorder traversal) https://ide.codingblocks.com/s/223498

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.