The Weekly Challenge - 113, TASK #2: Recreate Binary Tree

You are given a Binary Tree.

Write a script to replace each node of the tree with the sum of all the remaining nodes.

NOTE

There is a blog post about this.