c++ || 87.5 % beats || BFS Traversal || easy to understand
\n\n/**\n * Definition for a binary tree node.\n * struct TreeNode {\n *     int val;\n *     TreeNode *left;\n *     TreeNode *right;\n *     TreeNode() : val(
\n```\n/**\n * Definition for a binary tree node.\n * struct TreeNode {\n *     int val;\n *     TreeNode *left;\n *     TreeNode *right;\n *     TreeNode() : val(0), left(nullptr), right(nullptr) {}\n *     TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}\n *     TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}\n * };\n */\nclass Solution {\npublic:\n    void dfs(TreeNode* root,vector<int>&v){\n\n     queue<TreeNode*>q;\n     q.push(root);\n     int value=0;\n     while(!q.empty()){\n         int size=q.size();\n         for(int i=0;i<size;++i){\n             TreeNode* node=q.front();\n              value+=node->val;\n             q.pop();\n             if(node->left){\n                 q.push(node->left);\n             }\n             if(node->right){\n                 q.push(node->right);\n             }\n         }\n         v.push_back(value);\n         value=0;\n\n     }\n\n    }\n\n\n    int maxLevelSum(TreeNode* root) {\n      vector<int>num;\n      dfs(root,num);\n      auto max_ele=max_element(num.begin(),num.end());\n      int index=max_ele-num.begin();\n      return index+1;\n\n    }\n};\n```
['C++']