1. Understand the problem through an example

What is a valid Binary Search Tree (BST)?

A Binary Search Tree (BST) must satisfy these rules for every node:

Example 1 — Valid BST

        5
       / \
      3   8
     / \ / \
    1  4 7  9

Check the nodes:

Every node satisfies the BST rules.

Output: True

2. Signal

Key observations