0653. Two Sum IV - Input is a BST
Easy | Binary Search Tree + Stack | 72 ms (92.85%), 16.6 MB (76.64%)
Last updated
Was this helpful?
Easy | Binary Search Tree + Stack | 72 ms (92.85%), 16.6 MB (76.64%)
Last updated
Was this helpful?
Source: GitHub:
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.