Compute maximum sum in a tree without adjacency | ZipHQ