To solve the Leetcode problem "Two Sum IV - Input is a BST in c++.
Admins please assign this to me under LGM SOC'21.
Details
Given the root of a Binary Search Tree and a target number k, return true if there exist two elements in the BST such that their sum is equal to the given target.
Input: root = [5,3,6,2,4,null,7], k = 28
Output: false
Aim
To solve the Leetcode problem "Two Sum IV - Input is a BST in c++. Admins please assign this to me under LGM SOC'21.
Details
Given the root of a Binary Search Tree and a target number k, return true if there exist two elements in the BST such that their sum is equal to the given target.
Input: root = [5,3,6,2,4,null,7], k = 28 Output: false
Input: root = [2,1,3], k = 4 Output: true
Programming language