LeetCode 653 Two Sum IV - Input is a BST - In Order Traversal (Easy, Java, O(n))
LeetCode 653. Two Sum IV - Input is a BST
Approach
The problem requires us to find if there exist any two nodes in a Binary Search Tree (BST) that sum up to a given target value k.
The solution uses an inorder traversal approach combined with a has...
huanganni.hashnode.dev3 min read