← Deutsche Bank questions

Maximum tree diameter given level node counts

Filed under Deutsche Bank

Given an array count where count[i] denotes the number of nodes present at the i-th level of a tree (with root at level 1), output the maximum possible diameter (longest path in terms of edges).

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Deutsche Bank questions

Collected from public candidate posts and coding forums. Updated Nov 2026.