Solve Maximum Disjoint Subtree Product

Find the maximum possible product of the sums of the weights of two disjoint subtrees. Solving code challenges on HackerRank is one of the best ways to prepare for programming interviews.