New update is available. Click here to update.

Last Updated: 2 Nov, 2020

Difficulty: Moderate

```
The first line of input contains an integer ‘T’ denoting the number of test cases to run. Then the test case follows.
The first line of each test case contains an integer ‘N’ denoting the number of nodes of the binary tree.
The second line of each test case contains ‘N’ single space-separated integers, denoting the Inorder traversal of the binary tree.
The third line of each test case contains ‘N’ single space-separated integers, denoting the Level Order traversal of the binary tree.
```

```
For each test case, print the height of the binary tree.
Output for every test case will be printed in a separate line.
```

```
You do not need to print anything; it has already been taken care of. Just implement the given function.
```

```
1 <= T <= 100
1 <= N <= 3000
1 <= inorder[i] <= N
1 <= levelOrder[i] <= N
Time Limit: 1 sec
```

SIMILAR PROBLEMS

Ninja and Tree

Posted: 5 Feb, 2022

Difficulty: Ninja

Kth Largest Element in BST

Posted: 12 Mar, 2022

Difficulty: Moderate

Height of Binary Tree

Posted: 22 Apr, 2022

Difficulty: Easy

Min Heap

Posted: 5 May, 2022

Difficulty: Moderate

Locked Binary Tree

Posted: 12 May, 2022

Difficulty: Easy

Popular Interview Problems: