



The first line contains an Integer 't' which denotes the number of test cases or queries to be run. Then the test cases follow.
The First line of each test case contains the integer ‘n’ denoting the number of elements in the binary tree.
The second of each test case line contains n space-separated integers denoting the value of the node of the binary tree.
The third line of each test case contains n space-separated integers each being 0 or 1. Here 0 means that the node is not a leaf node and 1 means that the node is a leaf node.
For each test case, return the root node of the constructed tree.
Output for each query must be printed in a new line.
You do not need to print anything, it has already been taken care of. Just implement the given function.
1 <= T <= 50
1 <= N <= 10^3
-10^9 <=pre[i] <=10^9
Where ‘T’ is the total number of test cases and N denotes the number of elements in the ‘pre’ and the ‘isLeaf’ array and ‘pre[i]’ denotes the range of values for any element inf the ‘pre’ array.
Time limit: 1 sec
Keeping in mind the above idea, we can devise the following recursive approach:
Keeping in mind the above idea, we can devise the following recursive approach: