Jugad lga liya Bina Recursion ke 😂 || Hindi 💥 Explanation || C++ Solution
\n\n# Intuition\n Describe your first thoughts on how to solve this problem. \n dekho recursion se socha,\n kuchch strike nhi kiya\n agr huaa to update kr dunga
![image.png](https://assets.leetcode.com/users/images/595c832d-a4ff-470b-accd-8f19e5b75e24_1709089505.2078602.png)\n\n# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n* dekho recursion se socha,\n* kuchch strike nhi kiya\n* agr huaa to update kr dunga\n* ese dekh lo phelo\n* to level order lga diya\n* bina vector ke thik hai n \uD83D\uDE02\n# Approach\n<!-- Describe your approach to solving the problem. -->\n* code me dekhte hai\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\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    int findBottomLeftValue(TreeNode* root) {\n        // queue le liya bfs ke liye\n        queue<TreeNode*> q; \n        q.push(root); \n\n        int ans=0;\n        while(!q.empty()){\n\n            // esse n level wise traverse kar payenge\n            // ek loop lga denge to\n            int sz=q.size();\n\n            // ye variable har level ke pehle\n            // element ko pta klarne me madad krega\n            int first=0;\n            for(int i=0;i<sz;i++){\n                auto it=q.front();\n                q.pop(); \n\n                // agr first zero yani\n                // us level ka pehle element \n                if(first==0){\n                    // store kiya answer me and\n                    // first update kar diya\n                    ans=it->val;\n                    first=1;\n                }\n\n                // baki further BFS lga diya\n                if(it->left!=NULL) q.push(it->left);\n                if(it->right!=NULL) q.push(it->right);\n            }\n        }\n        // answer return kar diya\n        // agr recursion wala hoga to update kr dunga\n        return ans;\n    }\n};\n```
['Tree', 'Breadth-First Search', 'Binary Tree', 'C++']