static TreeNode bptHelper(int[]A, int s1, int e1, int s2, int e2, Map<Integer,Integer>map) {
		if (s1==e1)
			return null;
		TreeNode node=new TreeNode (A[e1-1]);
		int mid=map.get(A[e1-1]), len=mid-s2;
		node.left=bptHelper(A,s1,s1+len, s2, mid, map);
		node.right=bptHelper(A,s1+len,e1-1, mid+1, e2,map);
		return node;
	}