A binary tree is considered symmetric if it is a mirror image of itself, i.e, it is symmetric around its root node.
Given the root node of a binary tree, determine whether it's symmetric.
The first line contains an integer T denoting the number of test cases.
For each test case, the input has 2 lines:
For each test case, the output contains a line with 1 or 0 based on whether the tree is symmetric or not respectively.
4
7
1 2 2 4 -1 -1 4
7
6 4 4 -1 2 -1 2
7
1 2 3 4 -1 -1 4
1
6
1
0
0
1
1 <= T <= 10
1 <= n <= 105
1 <= node value <= 106