1617. Count Subtrees With Max Distance Between Cities
Description
**Input:** n = 4, edges = [[1,2],[2,3],[2,4]]
**Output:** [3,4,0]
**Explanation:**The subtrees with subsets {1,2}, {2,3} and {2,4} have a max distance of 1.
The subtrees with subsets {1,2,3}, {1,2,4}, {2,3,4} and {1,2,3,4} have a max distance of 2.
No subtree has two nodes where the max distance between them is 3.
**Input:** n = 2, edges = [[1,2]]
**Output:** [1]ac
Previous1616. Split Two Strings to Make PalindromeNext1618. Maximum Font to Fit a Sentence in a Screen
Last updated
