Given the root of a Binary Search Tree (BST), return the minimum absolute difference between the values of any two different nodes in the tree.
Example 1
Input: root = [4,2,6,1,3]
Output: 1
Explanation: An in-order walk gives the sorted values 1, 2, 3, 4, 6. The smallest gap between neighbours is 1 (for example 1 and 2).
Example 2
Input: root = [1,0,48,null,null,12,49]
Output: 1
Explanation: The sorted values are 0, 1, 12, 48, 49. Both 0/1 and 48/49 differ by 1, which is the minimum.
Example 3
Input: root = [5,3,7]
Output: 2
Explanation: The sorted values are 3, 5, 7. Neighbours differ by 2.
An in-order traversal of a BST visits values in sorted order, so the closest pair must be adjacent in that sequence. Track the previous value and take the smallest gap between consecutive visits.
Run checks all cases above. Submit evaluates all test cases.