Amazon Interview Question

given a bst, replace each node with sum of itself and the nodes with value greater than the current node