← Salesforce questions

Find Level with Maximum Sum in Binary Tree

Filed under Salesforce

Given the root of a binary tree, find the level (0-indexed or 1-indexed) that has the maximum sum of its node values. If multiple levels share the same maximum sum, return the minimum level.

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 Salesforce questions

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