
[LeetCode] 2467. Most Profitable Path in a Tree (Python)
·
알고리즘/LeetCode
난이도: Medium문제 설명There is an undirected tree with n nodes labeled from 0 to n - 1, rooted at node 0. You are given a 2D integer array edges of length n - 1 where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree. At every node i, there is a gate. You are also given an array of even integers amount, where amount[i] represents:the price needed to open the gate ..