Leetcode # 2846. Minimum Edge Weight Equilibrium Queries in a Tree

Problem

https://leetcode.com/contest/weekly-contest-361/problems/minimum-edge-weight-equilibrium-queries-in-a-tree/

  • There is an undirected tree with n nodes labeled from 0 to n – 1.
    You are given the integer n and a 2D integer array edges of length n – 1
    No loop.
  • Return minimum number of operations.
    ≡ Return minimum number of times to change the weights of edges.

Testcases

# Input Expected
1
 
 

相關例題

  •  

Solution
[Time Limit Exceeded  0 / 0 testcases passed]

Time Complexity: O()
Space Complexity: O()
(The input and output generally do not count towards the space complexity.)

 

 

Last Updated on 2023/09/10 by A1go

目錄
Bitnami