




Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Calculate the sum for each level then find the level with the maximum sum.
How can you traverse the tree ?
How can you sum up the values for every level ?
Use DFS or BFS to traverse the tree keeping the level of each node, and sum up those values with a map or a frequency array.