Sponsored
Use these hints if you're stuck. Try solving on your own first.
Create a datastructure with 4 parameters: (sum, isBST, maxLeft, minRight).
In each node compute theses parameters, following the conditions of a Binary Search Tree.
Solve with full IDE support and test cases