Ezvor

333. Largest BST Subtree

MediumDynamic Programming Preparing judge… LeetCode
Dynamic ProgrammingTreeDepth-First SearchBinary Search TreeBinary TreeDP on Trees

Hints

Hint 1
You can recursively use algorithm similar to 98. Validate Binary Search Tree at each node of the tree, which will result in O(nlogn) time complexity.