✅ EASY JAVA SOLUTION || Easy peasy lemon squeezy😊 || SIMPLE
\n# Code\n\nclass FindElements {\n    TreeNode root;\n    Set<Integer> set = new HashSet<>();\n    public FindElements(TreeNode root) {\n        this.root = roo
\n# Code\n```\nclass FindElements {\n    TreeNode root;\n    Set<Integer> set = new HashSet<>();\n    public FindElements(TreeNode root) {\n        this.root = root;\n        if(root != null){ root.val = 0; set.add(root.val); }\n        recover(root,set);\n    }\n    \n    public boolean find(int target) {\n      return set.contains(target);\n    }\n\n    private void recover(TreeNode root, Set<Integer> set){\n        if(root.left != null){\n            root.left.val = 2 * root.val + 1;\n            set.add(root.left.val);\n            recover(root.left, set);\n        }\n       if(root.right != null){\n            root.right.val = 2 * root.val + 2;\n            set.add(root.right.val);\n            recover(root.right, set);\n       } \n    }\n}\n```
['Java']