← All problemsSign in

783. Minimum Distance Between BST Nodes

LeetCodeTreeDepth-First SearchBreadth-First SearchBinary Search TreeBinary TreeOpen on judge ↗

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 1: Input: root = [4,2,6,1,3] Output: 1 Example 2: Input: root = [1,0,48,null,null,12,49] Output: 1 Constraints: - The number of nodes in the tree is in the range [2, 100]. - 0 <= Node.val <= 105 Note: This question is the same as 530: https://

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start