Skip to content

Commit c0b52ab

Browse files
refactor 1161
1 parent 4b2f693 commit c0b52ab

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

src/main/java/com/fishercoder/solutions/_1161.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,6 @@
66
import java.util.Queue;
77
import java.util.TreeMap;
88

9-
/**
10-
* 1161. Maximum Level Sum of a Binary Tree
11-
*
12-
* Given the root of a binary tree, the level of its root is 1, the level of its children is 2, and so on.
13-
* Return the smallest level X such that the sum of all the values of nodes at level X is maximal.
14-
*
15-
* Example 1:
16-
* 1
17-
* / \
18-
* 7 0
19-
* / \
20-
* 7 -8
21-
*
22-
* Input: [1,7,0,7,-8,null,null]
23-
* Output: 2
24-
*
25-
* Explanation:
26-
* Level 1 sum = 1.
27-
* Level 2 sum = 7 + 0 = 7.
28-
* Level 3 sum = 7 + -8 = -1.
29-
* So we return the level with the maximum sum which is level 2.
30-
*
31-
* Note:
32-
* The number of nodes in the given tree is between 1 and 10^4.
33-
* -10^5 <= node.val <= 10^5
34-
* */
359
public class _1161 {
3610
public static class Solution1 {
3711
public int maxLevelSum(TreeNode root) {

0 commit comments

Comments
 (0)