Given a tree where each node has a value, find the maximum product of node values along any path from the root to a leaf node, with the path consisting of distinct nodes.
Explanation: The path with the maximum product from the root to a leaf is 2 -> 4 -> 8.
Dynamic programming over tree structures
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak