1161. Maximum Level Sum of a Binary Tree
Last updated
Last updated
**Input:** root = [1,7,0,7,-8,null,null]
**Output:** 2
**Explanation:**
Level 1 sum = 1.
Level 2 sum = 7 + 0 = 7.
Level 3 sum = 7 + -8 = -1.
So we return the level with the maximum sum which is level 2.**Input:** root = [989,null,10250,98693,-89388,null,null,null,-32127]
**Output:** 2