Easy to Understand Javascript Solution, 84ms, beats 91%
Serialize: push all nodes\' value into an array in pre-order, and join them with \',\' or any non-numeric character\n\nvar serialize = function(root) {\n    if 
Serialize: push all nodes\' value into an array in pre-order, and join them with \',\' or any non-numeric character\n```\nvar serialize = function(root) {\n    if (root === null) return \'\';\n    let result = [];\n    serializeHelper(root, result);\n    return result.join(\',\');\n};\n\nconst serializeHelper = function(node, result) {\n    if (node) {\n        result.push(node.val);\n        serializeHelper(node.left, result);\n        serializeHelper(node.right, result);\n    }\n};\n```\nDeserialize: Split the data to get the pre-order array. Here we know two facts:\n1. The input tree and all its sub-trees are BST, so all values from the left sub-tree are less than the value of root node, and all values from the right sub-tree are greater than the value of root node.\n2. The array is a pre-order traversal of the tree, which means root always comes first, then left sub-tree (could be missing), then right sub-tree (could be missing).\n\nSo, the tree can be reconstructed by:\n\n1. Set array[0] as root and remove it from the array. \n2. Check the new array[0]. It could be either root.left or root.right (when root.left is null). We can decide it by checking if array[0] is in the range of two sub-trees. These ranges are (currentLowerBound, root.val) and (root.val, currentUpperBound);\n3. Do the same thing recursively to left and right subtree.\n\n```\nvar deserialize = function(data) {\n    if (!data) return null;\n    const array = data.split(\',\');\n    return deserializeHelper(array, Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY);\n};\n\nconst deserializeHelper = function(array, min, max) {\n    if (array.length === 0) return null;\n    let val = +array[0];\n    if (val < min || val > max) return null;\n    array.shift();\n    let root = new TreeNode(val);\n    root.left = deserializeHelper(array, min, val);\n    root.right = deserializeHelper(array, val, max);\n    return root;\n};\n```
[]