LeetCode75-1161-Max-Level-Sum
🧠 Summary of Thoughts
Idea
To solve this problem, we use Breadth-First Search (BFS) to traverse the binary tree level by level. We maintain a queue to store nodes for BFS traversal. For each level, we calculate the sum of all node values and compare it with the current maximum sum. If the current level sum is greater than the maximum sum seen so far, we update the maximum sum and record the corresponding level number.
✅ Code(Java)
1 | |
LeetCode75-1161-Max-Level-Sum
https://powersixxx.github.io/leetcode-blog/2026/03/07/LeetCode75-1161-Max-Level-Sum/