The simliar method has used to sovle the problem in preOrder and inOrder.It is really accepted.When I use the method in this situation.Time Limit Exceeded...Why?

```
public class Solution {
public TreeNode buildTree(int[] inorder, int[] postorder) {
return helper(postorder.length-1,0,inorder.length-1,inorder,postorder);
}
public TreeNode helper(int preend,int instart,int inend,int[] inorder,int[] postorder){
if(instart>inend||preend<0) return null;
TreeNode head = new TreeNode(postorder[preend]);
int index=0;
for(int i=instart;i<=inend;i++){
if(inorder[i]==head.val){
index=i;
}
}
head.left= helper(preend-index-1+instart,instart,index-1,inorder,postorder);
head.right=helper(preend-1,index+1,inend,inorder,postorder);
return head;
}
}
```