Recursive: valid(node, lo, hi) — base null return True; if node.val ≤ lo or ≥ hi return False; return valid(left, lo, node.val) and valid(right, node.val, hi).
✎ Whiteboard
3
⌨ Type It
Practice until you don't need to look. Use the guide comments below as scaffolding. The green highlights are the nuances to burn into memory.