Serialization is the process of converting a binary tree into a string so that it can be stored or transmitted and later reconstructed into the exact same tree structure and node values.
Implement serialize(root) and deserialize(data) and return deserialize(serialize(root)) from serialize_and_deserialize.
Input / output
root: TreeNode (represented in level-order array form in test fixtures)TreeNode — the reconstructed binary tree[0, 10^4]-1000 <= Node.val <= 1000How would you adapt your format if the tree were guaranteed to be a Binary Search Tree (BST) so you wouldn't need to store null markers?