1150. Two Sum BSTs

Medium
Two Pointers
Binary Search
Stack
Tree
Depth-First Search
Binary Search Tree
Binary Tree

Description

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.

Statistics

Acceptance
68.1%
Submissions
88,726
Accepted
60,448