Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
You can recursively use algorithm similar to <a href="https://leetcode.com/problems/validate-binary-search-tree/">98. Validate Binary Search Tree</a> at each node of the tree, which will result in O(nlogn) time complexity.