Microsoft Qn:

 Replace element with sum of all elements greater than it