Java Easy Solution using HashSet
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\nSave all the nodes value in HashSet\n Describe your approach to solving t
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nSave all the nodes value in HashSet\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(N)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass FindElements {\n\n    Set<Integer> nodes;\n    public FindElements(TreeNode root) {\n        nodes = new HashSet<>();\n        recover(root,0);\n    }\n    private void recover(TreeNode root, int parent){\n        if(root == null){\n            return;\n        }\n        root.val = parent;\n        nodes.add(root.val);\n        recover(root.left,2*parent+1);\n        recover(root.right,2*parent+2);\n    }\n    public boolean find(int target) {\n        return nodes.contains(target);\n    }\n}\n```
['Hash Table', 'Java']