Leetcode 2467. Most Profitable Path in a Tree
In a rooted tree where each node has a positive or negative gate amount, Bob moves from a given node toward the root while Alice chooses a path from the root to any leaf; if they visit a node simultaneously the amount is split, otherwise only the first visitor gains/loses it — compute the maximum net income Alice can achieve. The core challenge is computing Bob's arrival times along his path and doing a DFS to maximize Alice's time-adjusted path sum.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.