Medium
,Tree
,DFS
,BFS
,Binary Tree
1161. Maximum Level Sum of a Binary Tree
Given the root
of a binary tree, the level of its root is 1
, the level of its children is 2
, and so on.
Return the smallest level x
such that the sum of all the values of nodes at level x
is maximal.
Example 1:
Example 2:
Constraints:
Node.val
<= 105