Validate BST
Medium
Trees
DFS
Inorder
Implement the Validate BST algorithm.
Input: as specified
Output: result
Constraints
Standard constraints apply.
Examples
Example 1:
Input: sample
Output:
Example 2:
Input: test
Output:
Hints
Consider a dfs approach.
Tests:
Runtime:
Memory:
Test
Input:
Expected:
Got:
Click Run Code to test against sample cases, or Submit to test against all cases.
▲ Console