Want to solve this problem? Login now to get access to solve the problems
The first line contains a single integer T representing the number of test cases. The T-test cases are as follows: Line 1: Elements in the level order form (separated by space). If any node does not have a left or right child, take -1 in its place Line 2: Integer M
For each test case, print the level of the node M in the binary tree The output of each test case should be printed in a separate line.
1 <= T <= 100 1 <= N <= 3000 1 <= nodeVal <= 10^9 Time Limit: 1 sec
You do not need to print anything, it has already been taken care of. Just implement the given function.
1 1 2 3 -1 -1 -1 -1 3