serialize = function(root, result = []) {
    serial(root, result);

    return result;
}
Encodes a tree to a single string.
https://leetcode.com/problems/serialize-and-deserialize-binary-tree/solution/
Time O(N) | Space O(H)
@param {TreeNode} root
@return {string}