Easy BFS solution c++
Intuition\nThe idea is to perform a level-order traversal (BFS) of the binary tree and return the leftmost value from the last level.\n\n# Approach\nWe can use 
# Intuition\nThe idea is to perform a level-order traversal (BFS) of the binary tree and return the leftmost value from the last level.\n\n# Approach\nWe can use a queue to perform level-order traversal. We start by pushing the root node into the queue. Then, for each level, we update leftmostValue to the value of the leftmost node in that level. After processing all nodes at the current level, we move to the next level by adding the children of the current nodes to the queue. We continue this process until we reach the last level of the tree. Finally, we return the value stored in leftmostValue.\n\n# Complexity\n- Time complexity:\nO(n), where n is the number of nodes in the binary tree. Each node is visited once during the level-order traversal.\n\n- Space complexity:\nO(w), where w is the maximum width of the tree (the number of nodes in the widest level). In the worst case, the queue may contain all nodes at the last level, so the space complexity is O(w).\n\n# Code\n```\n#include <queue>\n\nclass Solution {\npublic:\n    int findBottomLeftValue(TreeNode* root) {\n        if (!root) {\n            return 0; // or any default value based on the problem constraints\n        }\n\n        int leftmostValue = 0;\n        std::queue<TreeNode*> q;\n        q.push(root);\n\n        while (!q.empty()) {\n            int levelSize = q.size();\n            leftmostValue = q.front()->val;\n\n            for (int i = 0; i < levelSize; ++i) {\n                TreeNode* current = q.front();\n                q.pop();\n\n                if (current->left) {\n                    q.push(current->left);\n                }\n\n                if (current->right) {\n                    q.push(current->right);\n                }\n            }\n        }\n\n        return leftmostValue;\n    }\n};\n\n```\nUPVOTE IF YOU FIND ITS USEFULL
['Tree', 'Breadth-First Search', 'Binary Tree', 'C++']