Login

All Problems

Problem title

Difficulty

Avg time to solve

Rearrange Sentences

Easy

10 mins

Ninja visits his friend

Moderate

30 mins

Convert ternary expression to a binary tree.

Easy

15 mins

Print Name and Age

Easy

5 mins

Last Substring In Lexicographical Order

Hard

45 mins

Decryption

Easy

10 mins

Max Sum After 'K' Negations

Easy

15 mins

Minimize the difference

Moderate

45 mins

Eat Favourite Pizza On Given Day

Moderate

25 mins

Balanced Binary Tree

Moderate

30 mins

Problem

Submissions

0

Avg. time to solve

30 min

Success Rate

50%

Problem Statement

```
Input:
H = 2
Output:
3
There will be a total 3 different balanced binary trees with height 2.
One node as a root and other nodes on one of the two sides.
One with root and left subtree with one more node than right.
One with root and right subtree with one more node than left.
```

```
The first line contains a single integer 'T' denoting the number of test cases to be run. Then the test cases follow.
Each test case contains a single integer 'H' denoting the height of the tree.
```

```
For each test case, print an integer denoting the number of balanced binary trees that can be made with a given height.
Answers for each test case will be printed in a separate line.
```

```
You are not required to print anything; it has already been taken care of. Just implement the function and return the answer.
```

```
1 <= T <= 50
1 <= H <= 10^6
Time Limit: 1 sec.
```

```
2
3
1
```

```
15
1
```

```
In test case 1:
We can make 15 different balanced binary trees with a height 3.
In test case 2:
We can make only 1 balanced binary tree with a height 1.
```

```
2
2
4
```

```
3
315
```

Console

Sample Test Case

Custom Test Case

Download Test Cases

Test Case 1

Test Case 2

Test Case 3

Saving Code...

Full Screen Mode

Change Language

Change Theme

Solution submission not allowed

Save Code

Reset Code