C++ | BFS | 10 lines | Clean && Simple Code💯
\n# Complexity\n- Time complexity: O(n)\n\n- Space complexity: O(n)\n\n# Code\n\nclass Solution {\npublic:\n    int findBottomLeftValue(TreeNode* root) {\n     
\n# Complexity\n- Time complexity: O(n)\n\n- Space complexity: O(n)\n\n# Code\n```\nclass Solution {\npublic:\n    int findBottomLeftValue(TreeNode* root) {\n        queue<TreeNode*> levelQue;\n        levelQue.push(root);\n        int leftNodeVal = root->val;\n        while (!levelQue.empty()) {\n            int currLevelSize = levelQue.size();\n            int orgSize = currLevelSize;\n            while (currLevelSize-- > 0) {\n                TreeNode* currNode = levelQue.front();\n                levelQue.pop();\n                if (orgSize - 1 == currLevelSize)\n                    leftNodeVal = currNode->val;\n                if (currNode->left != NULL)\n                    levelQue.push(currNode->left);\n                if (currNode->right != NULL)\n                    levelQue.push(currNode->right);\n            }\n        }\n        return leftNodeVal;\n    }\n};\n```
['Breadth-First Search', 'C++']