Given the root of a binary tree, return the number of nodes in the largest subtree that is itself a valid binary search tree. A subtree includes a node and all its descendants. The tree is given as a level-order array.
Input: A level-order array of the tree.
Output: Integer — the size of the largest BST subtree.
Input: [10,5,15,1,8,null,7]
Output: 3
Explanation: The subtree rooted at 5 (nodes 5,1,8) is a BST of size 3.Input: [2,1,3]
Output: 3
Explanation: The whole tree is a BST.Input: [1]
Output: 1
Explanation: Single node.1<=nodes<=10^4-10^4<=value<=10^4