GoLang Solution For LeetCode Problem: Two Sum IV Input is a BST
Solving Two Sum IV Input is a BST in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.
Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target.
Input: 5 / \ 3 6 / \ \ 2 4 7 Target = 9 Output: True
Input: 5 / \ 3 6 / \ \ 2 4 7 Target = 28 Output: False
See the full details of the problem Two Sum IV Input is a BST at LeetCode
Originally posted at: @github.com/halfrost/LeetCode-Go