Beginner friendly Python Soluiton
Time Complexity : O(N)\n\n# Definition for a binary tree node.\n# class TreeNode(object):\n#     def __init__(self, val=0, left=None, right=None):\n#         se
**Time Complexity : O(N)**\n```\n# Definition for a binary tree node.\n# class TreeNode(object):\n#     def __init__(self, val=0, left=None, right=None):\n#         self.val = val\n#         self.left = left\n#         self.right = right\nclass FindElements(object):\n\n    def __init__(self, root):\n        self.st = set()\n        \n        def recover(root, val) :\n            if(root):\n                self.st.add(val)\n                recover(root.left, 2 * val + 1)\n                recover(root.right, 2 * val + 2)\n        \n        recover(root, 0)\n        \n\n    def find(self, target):\n        return target in self.st\n        \n\n\n# Your FindElements object will be instantiated and called as such:\n# obj = FindElements(root)\n# param_1 = obj.find(target)\n```
['Python']