Easy Solution || BFS || DFS || C++
DFS Solution :\n\n\n\tvoid dfs(TreeNode* root, int l, vector<int>& sum)\n    {\n        if(!root)\n            return;\n        \n        if(sum.size() < l)\n  
DFS Solution :\n\n```\n\tvoid dfs(TreeNode* root, int l, vector<int>& sum)\n    {\n        if(!root)\n            return;\n        \n        if(sum.size() < l)\n            sum.push_back(root->val);\n        else\n            sum[l-1] += root->val;\n        \n        dfs(root->left,l+1,sum);\n        dfs(root->right,l+1,sum);\n    }\n        \n    int maxLevelSum(TreeNode* root) {\n        vector<int> sum;\n        dfs(root,1,sum);\n        \n        int ans = INT_MIN, ind = -1; \n        for(int i=0; i<sum.size(); i++)\n        {\n            if(ans < sum[i])\n            {\n                ans = sum[i];\n                ind = i;\n            }\n        }\n        \n        return ind+1;\n    }\n```\n\nBFS Solution :\n\n```\n\tint maxLevelSum(TreeNode* root) {\n        if(!root)\n            return 0;\n        \n        int sum=0, maxi = 0, ans=0, ind = 1;\n        queue<TreeNode*> q;\n        q.push(root);\n        q.push(NULL);\n        \n        while(!q.empty())\n        {\n            TreeNode* t = q.front();\n            q.pop();\n            \n            if(t == NULL)\n                continue;\n            \n            sum += t->val;\n            \n            if(t->left)\n                q.push(t->left);\n            if(t->right)\n                q.push(t->right);\n            \n            if(q.front() == NULL)\n            {\n                q.pop();\n                q.push(NULL);\n                if(sum > maxi)\n                {\n                    maxi = sum;\n                    ans = ind;\n                }\n                sum = 0;\n                ind++;\n            }\n            \n        }\n        return ans;\n    }\n```
['Depth-First Search', 'Breadth-First Search', 'C']