Java Clean Code with single queue
\nclass Solution {\n    public int maxLevelSum(TreeNode root) {\n        int maxValue = Integer.MIN_VALUE;\n        int minLevel = 1;\n        int currLevel = 0
```\nclass Solution {\n    public int maxLevelSum(TreeNode root) {\n        int maxValue = Integer.MIN_VALUE;\n        int minLevel = 1;\n        int currLevel = 0;\n        \n        Queue<TreeNode> q = new ArrayDeque<>();\n        q.add(root);\n        \n        while (q.size() > 0) {\n            int size = q.size();\n            currLevel++;\n            int sumLevel = 0;\n            \n            for (int i = 0; i < size; i++) {\n                TreeNode node = q.poll();\n                sumLevel += node.val;\n                if (node.left != null) {\n                    q.add(node.left);\n                }\n                \n                if (node.right != null) {\n                    q.add(node.right);\n                }\n            }\n            \n            if (maxValue < sumLevel) {\n                minLevel = currLevel;\n                maxValue = sumLevel;\n            }\n        }\n        \n        return minLevel;\n    }\n}\n```
[]