BBT counter
Submissions: 1267   Accuracy:

18.55%

  Difficulty: Easy   Marks: 2

Given a height h, count and return the maximum number of balanced binary trees possible with height h. A balanced binary tree is one in which for every node, the difference between heights of left and right subtree is not more than 1.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains an integer height h.

Output:
Count the maximum number of balanced binary trees possible with height h.

Constraints:
1<=T<=100
1<=h<=1000

Example:
Input:

2
3
70

Output:
40
327960719

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Ayush Govil
Author: Ayush Govil 1


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.