NeetCode #411LC-1522MediumTreesNC Algo100
← Back to All Problems

#411 · #1522 · Diameter of N-Ary Tree(N 叉树的直径)

📌 Problem Statement & Constraints

Given the root of an N-ary tree, return its diameter: the length of the longest path between any two nodes, measured in edges. Constraints: the number of nodes is in [0, 10^4], the depth is at most 1000.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!