How would you check if a binary tree is vertically symmetric, meaning mirror symmetric?
Implement the check using the function below. The input is a binary tree represented by nested dictionaries with val, left, and right keys, where missing children are None; return True when the tree is its own mirror image and False otherwise.
root is a nested dictionary or None. Return a boolean.
val and left and right child referencesdef is_symmetric(root):