LeetCode
Inorder Successor in BST II
Click
here
for an explanation.