leetle

Daily challenge for 2025-02-21

52. Validate BST

Write a function solve that checks if a binary tree is a valid binary search tree. A valid BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node's key. The right subtree of a node contains only nodes with keys greater than the node's key. Both the left and right subtrees must also be binary search trees.

Example:
Input: [2,1,3]
Output: True

Run this challenge interactively in Python or JavaScript when the app loads.