Pergunta de entrevista da empresa Google

Tree construction and traversal, traveling knapsack-like problem, DP. Leetcode medium-hard.