Array
2467. Most Profitable Path in a Tree
A tree of n nodes; each node has amount[i] (income if positive, or a toll). Alice walks from node 0 to any leaf; Bob walks from node bob to node 0; both move one step per time unit. A node gives…
Loading…
A tree of n nodes; each node has amount[i] (income if positive, or a toll). Alice walks from node 0 to any leaf; Bob walks from node bob to node 0; both move one step per time unit. A node gives…
Loading…