Tap here to switch tabs
Problem
Submissions

Problem: Minimum Distance Between BST Nodes

Try to solve the Minimum Distance Between BST Nodes problem.

Statement

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

Constraints:

  • The number of nodes in the tree is in the range [2,100][2, 100].

  • 0≤0 \leq Node.val ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Distance Between BST Nodes

Try to solve the Minimum Distance Between BST Nodes problem.

Statement

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

Constraints:

  • The number of nodes in the tree is in the range [2,100][2, 100].

  • 0≤0 \leq Node.val ≤105\leq 10^5