Given the roots of two Binary Search Trees (BSTs) containing integer values, find the greatest common integer present in both trees. If there is no common integer, return -1.
Constraints:
- The number of nodes in both trees is in the range
. - Both trees are valid BSTs.
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Test Cases
Input
Output
Expected