...

/

Two Sum IV – Input Is a BST

Two Sum IV – Input Is a BST

Try to solve the Two Sum IV – Input Is a BST problem.

Statement

Given the root of a binary search tree and an integer k, determine whether there are two elements in the BST whose sum equals k. Return TRUE if such elements exist or FALSE otherwise.

Constraints:

    ...
    Access this course and 1400+ top-rated courses and projects.