# Leetcode 783 - Minimum Distance Between BST Nodes

Note:

• For each node, it’s min diff must exist between |val - leftMax| and |val - rightMin|.
• DFS every node, and use while loop to get rightMost of leftSubtree, and leftMost of rightSubtree.

Question:

Given the root of a Binary Search Tree (BST), return the minimum difference between the values of any two different nodes in the tree.

Example:

Code: