1214. Two Sum BSTs

Problem

Given the roots of two binary search trees, return true if there is a node in each tree whose values sum to target.

Given two binary search trees (BST) root1 and root2, determine if there exists a node with value a in the first tree and a node with value b in the second tree such that a + b = target.

Examples
Input: [[2,1,4],[1,0,3],5]
Output: true
Hints
Related Problems

1214. Two Sum BSTs

Given the roots of two binary search trees, return true if there is a node in each tree whose values sum to target.