Problem 1522 · Medium

Diameter of N-Ary Tree

Find the longest simple path, in edges, between any two nodes of an N-ary tree, measured without requiring the root.

Open the interactive visualisation