Pergunta de entrevista da empresa Amazon

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