

A subtree of a node X is all the nodes that are below X and X itself.
A binary tree is a tree consisting of at most two children.
Two subtrees are said to be equal if they both have the same structure and the corresponding nodes in both the subtrees are associated with the same character value.
The first line of each input has a single integer T, denoting the number of test cases.
The first line of each test case contains a single integer N, denoting the number of nodes in a tree.
The second line contains the keys of the nodes of the tree in the level order form ( # for NULL node) Refer to the example for further clarification.
Consider the binary tree

a
b c
d # e f
# g # # # #
# #
Explanation :
Level 1 :
The root node of the tree is a
Level 2 :
The left child of a = b
Right child of a = c
Level 3 :
Left child of b= d
Right child of b = null (#)
Left child of c = e
Right child of c = f
Level 4 :
Left child of d = null (#)
Right child of d = g
Left child of e = null (#)
Right child of e = null (#)
Left child of f = null (#)
Right child of f = null (#)
Level 5 :
Left child of g = null (#)
Right child of g = null (#)
The first not-null node (of the previous level) is treated as the parent of the first two nodes of the current level. The second not-null node (of the previous level) is treated as the parent node for the next two nodes of the current level and so on.
The input ends when all nodes at the last level are null (#).
For each test case print on a new line “True”, if there are two similar subtrees with size greater than or equal to 2, otherwise print “False”.
You do not need to print anything, it has already been taken care of. Just implement the given function.
1 <= T <= 100
1 <= N <= 500
a <= node value <= z
Time Limit: 1 sec.
3
a
b b
# # # #
Second Largest in Tree Level
Sorted Doubly Linked List to Balanced BST
Corporate Skill Diversity
Longest Substring with K-Repeating Characters
Expression Add Operators