Search
⌘K

Leetcode 1214. Two Sum BSTs

Given two binary search trees and a target integer, determine whether there exists one node from each tree whose values sum to the target. Leverage BST ordering to avoid brute-force pairing (e.g., use lookups or synchronized in-order / reverse in-order traversals to achieve near-linear time with low extra space).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.