Algorithm · Bloomberg · Medium
You are given the root of an N-ary tree. Determine which level contains the maximum number of nodes. Levels use 1‑based indexing: the root sits at level 1. When multiple levels tie for the highest node count, return the smallest level number among them. If the tree is empty, return 0. An N‑ary tree is a rooted tree where a node may have an arbitrary number of children. Note: The input tree is serialized using level‑order traversal. A null value acts as a separator between…
Checking your access…