333. Largest BST Subtree

Problem

Find the size of the largest subtree of a binary tree that is itself a valid BST.

Given the root of a binary tree, find the largest subtree that is also a valid Binary Search Tree. Return the size (number of nodes) of this largest BST subtree.

Examples
Input: [10,5,15,1,8,null,7]
Output: 3
Hints
Related Problems

333. Largest BST Subtree

Find the size of the largest subtree of a binary tree that is itself a valid BST.