2
* Definition for a binary tree node.3
* function TreeNode(val, left, right) {4
* this.val = (val===undefined ? 0 : val)5
* this.left = (left===undefined ? null : left)6
* this.right = (right===undefined ? null : right)10
* @param {TreeNode} root12
var FindElements = function (root) {15
recover = (root, val) => {17
if (root.left != null) recover(root.left, val * 2 + 1);18
if (root.right != null) recover(root.right, val * 2 + 2);25
* @param {number} target28
FindElements.prototype.find = function (target) {29
return this.st.has(target);33
* Your FindElements object will be instantiated and called as such:34
* var obj = new FindElements(root)35
* var param_1 = obj.find(target)