It seems that the test cases do not have nodes with equal values.
What happens if there are nodes with equal values?
It's a binary search tree, there should never be duplicates.
I know that it is the common practice.
But it really depends on your definition of BST.
I am wondering how to solve the problem if the BST allows duplicates.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.