Ezvor

1214. Two Sum BSTs

MediumTwo Pointers Preparing judge… LeetCode
Two PointersBinary SearchStackTreeDepth-First SearchBinary Search TreeBinary Tree

Hints

Hint 1
How can you reduce this problem to the classical Two Sum problem?
Hint 2
Do an in-order traversal of each tree to convert them to sorted arrays.
Hint 3
Solve the classical Two Sum problem.