[Java] BFS
BFS:\n\npublic int maxLevelSum(TreeNode root) {\n        if (root == null) return 0;\n        Queue<TreeNode> queue = new LinkedList<>();\n        queue.add(roo
BFS:\n```\npublic int maxLevelSum(TreeNode root) {\n        if (root == null) return 0;\n        Queue<TreeNode> queue = new LinkedList<>();\n        queue.add(root);\n        \n        int level = 0;\n        int minLevel = 0, maxSum = Integer.MIN_VALUE;\n        while (!queue.isEmpty()) {\n            int size = queue.size();\n            level++;\n            int levelSum = 0;\n            for (int i = 0; i < size; i++) {\n                TreeNode node = queue.poll();\n                levelSum += node.val;\n                if (node.left != null) queue.add(node.left);\n                if (node.right != null) queue.add(node.right);\n            }\n            if (levelSum > maxSum) {\n                maxSum = levelSum;\n                minLevel = level;\n            }\n        }\n        return minLevel;\n    }\n```
['Breadth-First Search', 'Queue', 'Java']