A binary tree stores one character at each node. The tree is given as a level-order array using heap-style indexing: for a node at index `i`, the left child is at `2*i + 1` and the right child is at `2*i + 2`. Missing nodes are represented by `None`.
Return a string formed by:
1. taking the left side view from bottom to top, then
2. appending the right side view from top to bottom,
while avoiding duplicates for nodes already included from the left side view.
A duplicate means the same tree node appearing in both views, not merely the same character value.
Examples
Input: (['a','b','c','d','e','f','g'],)
Expected Output: "dbacg"
Explanation: Left view is a, b, d, so bottom-to-top gives dba. Right view is a, c, g; skipping a because that node is already used leaves cg. Result: dbacg.
Input: ([],)
Expected Output: ""
Explanation: An empty array represents an empty tree, so the result is an empty string.
Input: (['z'],)
Expected Output: "z"
Explanation: The single root node is in both side views, but it is only included once.
Input: (['a','b',None,'c'],)
Expected Output: "cba"
Explanation: The only reachable nodes are a -> b -> c down the left side. Left view is a, b, c, so bottom-to-top is cba. The right view is the same nodes, so nothing extra is appended.
Input: (['a','b','c','d',None,None,'e'],)
Expected Output: "dbace"
Explanation: Left view is a, b, d, giving dba from bottom to top. Right view is a, c, e; skipping the shared root a leaves ce. Result: dbace.
Input: (['a','b','b','c',None,None,'c'],)
Expected Output: "cbabc"
Explanation: Left view is a, b, c, so bottom-to-top gives cba. Right view is a, b, c on different nodes at depths 1 and 2, so after skipping only the shared root, bc is appended. Equal character values do not count as duplicates if they are different nodes.
Input: ([None,'a','b'],)
Expected Output: ""
Explanation: A missing root means the tree is empty. Deeper array entries are ignored because they are not reachable from index 0.