Sponsored
Use these hints if you're stuck. Try solving on your own first.
Use DFS to traverse the binary tree and recover it.
Use a hashset to store TreeNode.val for finding.
Solve with full IDE support and test cases